IDZEBRA 2.2.11
retrieve.c File Reference
#include <stdio.h>
#include <assert.h>
#include <fcntl.h>
#include "index.h"
#include <yaz/diagbib1.h>
#include <yaz/snprintf.h>
#include <direntz.h>
#include <yaz/oid_db.h>
#include <zebra_strmap.h>

Go to the source code of this file.

Data Structures

struct  special_fetch_s
struct  index_spec
struct  term_collect

Macros

#define MAX_SYSNOS_PER_RECORD   40
#define ZEBRA_XML_HEADER_STR   "<record xmlns=\"http://www.indexdata.com/zebra/\""

Functions

static int zebra_create_record_stream (ZebraHandle zh, Record *rec, struct ZebraRecStream *stream)
struct index_spec * parse_index_spec (const char *elem, NMEM nmem, int *error)
static int sort_fetch (struct special_fetch_s *fi, const char *elemsetname, const Odr_oid *input_format, const Odr_oid **output_format, WRBUF result, WRBUF addinfo)
static void special_index_xml_record (ZebraHandle zh, WRBUF wrbuf, zebra_snippets *doc, zint sysno, struct index_spec *spec_list, const char *elemsetname, int use_xml)
static int special_index_fetch (struct special_fetch_s *fi, const char *elemsetname, const Odr_oid *input_format, const Odr_oid **output_format, WRBUF result, WRBUF addinfo, Record rec)
static void retrieve_puts_attr (WRBUF wrbuf, const char *name, const char *value)
static void retrieve_puts_attr_int (WRBUF wrbuf, const char *name, const int value)
static void retrieve_puts_str (WRBUF wrbuf, const char *name, const char *value)
static void retrieve_puts_int (WRBUF wrbuf, const char *name, const int value)
static void snippet_check_fields (ZebraHandle zh, WRBUF wrbuf, zebra_snippets *doc, const zebra_snippet_word *doc_w, const char *w_index_type)
static void snippet_xml_record (ZebraHandle zh, WRBUF wrbuf, zebra_snippets *doc)
int zebra_get_rec_snippets (ZebraHandle zh, zint sysno, zebra_snippets *snippets)
static int snippet_fetch (struct special_fetch_s *fi, const char *elemsetname, const Odr_oid *input_format, const Odr_oid **output_format, WRBUF result, WRBUF addinfo)
static zint freq_term (ZebraHandle zh, int ord, const char *term, RSET rset_set, zint *first_sysno, zint *first_seq)
static int term_qsort_handle (const void *a, const void *b)
static void term_collect_freq (ZebraHandle zh, struct term_collect *col, int no_terms_collect, int ord, RSET rset, double scale_factor)
static struct term_collect * term_collect_create (zebra_strmap_t sm, int no_terms_collect, NMEM nmem)
static int perform_facet_sort (ZebraHandle zh, int no_ord, int *ord_array, zebra_strmap_t *map_array, int num_recs, ZebraMetaRecord *poset)
static int perform_facet_index (ZebraHandle zh, struct special_fetch_s *fi, int no_ord, int *ord_array, zebra_strmap_t *map_array, int num_recs, ZebraMetaRecord *poset, struct index_spec *spec_list)
static int perform_facet (ZebraHandle zh, struct special_fetch_s *fi, WRBUF result, int num_recs, ZebraMetaRecord *poset, struct index_spec *spec_list, int no_ord, int *ord_array, int use_xml, zinfo_index_category_t cat)
static int facet_fetch (struct special_fetch_s *fi, const char *elemsetname, const Odr_oid *input_format, const Odr_oid **output_format, WRBUF result, WRBUF addinfo)
static int zebra_special_fetch (void *handle, const char *elemsetname, const Odr_oid *input_format, const Odr_oid **output_format, WRBUF result, WRBUF addinfo)
int zebra_record_fetch (ZebraHandle zh, const char *setname, zint sysno, int score, ODR odr, const Odr_oid *input_format, Z_RecordComposition *comp, const Odr_oid **output_format, char **rec_bufp, int *rec_lenp, char **basenamep, WRBUF addinfo_w)

Variables

static int log_level_mod = 0
static int log_level_set = 0

Macro Definition Documentation

◆ MAX_SYSNOS_PER_RECORD

#define MAX_SYSNOS_PER_RECORD   40

Definition at line 42 of file retrieve.c.

Referenced by perform_facet_index(), and zebra_record_fetch().

◆ ZEBRA_XML_HEADER_STR

#define ZEBRA_XML_HEADER_STR   "<record xmlns=\"http://www.indexdata.com/zebra/\""

Function Documentation

◆ facet_fetch()

◆ freq_term()

◆ parse_index_spec()

struct index_spec * parse_index_spec ( const char * elem,
NMEM nmem,
int * error )

◆ perform_facet()

◆ perform_facet_index()

◆ perform_facet_sort()

int perform_facet_sort ( ZebraHandle zh,
int no_ord,
int * ord_array,
zebra_strmap_t * map_array,
int num_recs,
ZebraMetaRecord * poset )
static

◆ retrieve_puts_attr()

void retrieve_puts_attr ( WRBUF wrbuf,
const char * name,
const char * value )
static

Definition at line 354 of file retrieve.c.

Referenced by zebra_special_fetch().

◆ retrieve_puts_attr_int()

void retrieve_puts_attr_int ( WRBUF wrbuf,
const char * name,
const int value )
static

Definition at line 365 of file retrieve.c.

Referenced by zebra_special_fetch().

◆ retrieve_puts_int()

void retrieve_puts_int ( WRBUF wrbuf,
const char * name,
const int value )
static

Definition at line 378 of file retrieve.c.

Referenced by zebra_special_fetch().

◆ retrieve_puts_str()

void retrieve_puts_str ( WRBUF wrbuf,
const char * name,
const char * value )
static

Definition at line 371 of file retrieve.c.

Referenced by zebra_special_fetch().

◆ snippet_check_fields()

void snippet_check_fields ( ZebraHandle zh,
WRBUF wrbuf,
zebra_snippets * doc,
const zebra_snippet_word * doc_w,
const char * w_index_type )
static

◆ snippet_fetch()

int snippet_fetch ( struct special_fetch_s * fi,
const char * elemsetname,
const Odr_oid * input_format,
const Odr_oid ** output_format,
WRBUF result,
WRBUF addinfo )
static

◆ snippet_xml_record()

◆ sort_fetch()

◆ special_index_fetch()

int special_index_fetch ( struct special_fetch_s * fi,
const char * elemsetname,
const Odr_oid * input_format,
const Odr_oid ** output_format,
WRBUF result,
WRBUF addinfo,
Record rec )
static

◆ special_index_xml_record()

◆ term_collect_create()

struct term_collect * term_collect_create ( zebra_strmap_t sm,
int no_terms_collect,
NMEM nmem )
static

◆ term_collect_freq()

void term_collect_freq ( ZebraHandle zh,
struct term_collect * col,
int no_terms_collect,
int ord,
RSET rset,
double scale_factor )
static

◆ term_qsort_handle()

int term_qsort_handle ( const void * a,
const void * b )
static

Definition at line 617 of file retrieve.c.

References term_collect::set_occur, and term_collect::term.

Referenced by term_collect_freq().

◆ zebra_create_record_stream()

◆ zebra_get_rec_snippets()

◆ zebra_record_fetch()

◆ zebra_special_fetch()

Variable Documentation

◆ log_level_mod

int log_level_mod = 0
static

◆ log_level_set