IDZEBRA  2.1.2
Data Structures | Macros | Functions
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_specparse_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 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)
 
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_collectterm_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)
 

Macro Definition Documentation

#define MAX_SYSNOS_PER_RECORD   40

Definition at line 42 of file retrieve.c.

Referenced by perform_facet_index(), and zebra_record_fetch().

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

Function Documentation

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
static zint freq_term ( ZebraHandle  zh,
int  ord,
const char *  term,
RSET  rset_set 
)
static
struct index_spec* parse_index_spec ( const char *  elem,
NMEM  nmem,
int *  error 
)
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
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
static int perform_facet_sort ( ZebraHandle  zh,
int  no_ord,
int *  ord_array,
zebra_strmap_t map_array,
int  num_recs,
ZebraMetaRecord poset 
)
static
static void retrieve_puts_attr ( WRBUF  wrbuf,
const char *  name,
const char *  value 
)
static

Definition at line 378 of file retrieve.c.

Referenced by zebra_special_fetch().

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

Definition at line 389 of file retrieve.c.

Referenced by zebra_special_fetch().

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

Definition at line 402 of file retrieve.c.

Referenced by zebra_special_fetch().

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

Definition at line 395 of file retrieve.c.

Referenced by zebra_special_fetch().

static void snippet_check_fields ( ZebraHandle  zh,
WRBUF  wrbuf,
zebra_snippets doc,
const zebra_snippet_word doc_w,
const char *  w_index_type 
)
static
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
static void snippet_xml_record ( ZebraHandle  zh,
WRBUF  wrbuf,
zebra_snippets doc 
)
static
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
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
static struct term_collect* term_collect_create ( zebra_strmap_t  sm,
int  no_terms_collect,
NMEM  nmem 
)
static
static void term_collect_freq ( ZebraHandle  zh,
struct term_collect col,
int  no_terms_collect,
int  ord,
RSET  rset,
double  scale_factor 
)
static
static int term_qsort_handle ( const void *  a,
const void *  b 
)
static

Definition at line 609 of file retrieve.c.

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

Referenced by term_collect_freq().

static int zebra_create_record_stream ( ZebraHandle  zh,
Record rec,
struct ZebraRecStream stream 
)
static
int zebra_get_rec_snippets ( ZebraHandle  zh,
zint  sysno,
zebra_snippets snippets 
)
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 
)
static int zebra_special_fetch ( void *  handle,
const char *  elemsetname,
const Odr_oid *  input_format,
const Odr_oid **  output_format,
WRBUF  result,
WRBUF  addinfo 
)
static