-/* $Id: index.h,v 1.186 2006-12-05 14:06:29 adam Exp $
- Copyright (C) 1995-2006
+/* $Id: index.h,v 1.205 2007-11-01 14:10:03 adam Exp $
+ Copyright (C) 1995-2007
Index Data ApS
This file is part of the Zebra server.
#include <idzebra/util.h>
#include <idzebra/flock.h>
#include <sortidx.h>
-
+#include <index_types.h>
#if HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
#include <sys/stat.h>
+#include <yaz/timing.h>
#include <idzebra/dict.h>
#include <idzebra/isams.h>
#include <idzebra/isamc.h>
ISAMB isamb;
Dict dict;
Dict matchDict;
- SortIdx sortIdx;
+ zebra_sort_index_t sort_index;
int registerState; /* 0 (no commit pages), 1 (use commit pages) */
time_t registerChange;
BFiles bfs;
char *server_path_prefix;
data1_handle dh;
- ZebraMaps zebra_maps;
+ zebra_index_types_t index_types;
+ zebra_maps_t zebra_maps;
ZebraRankClass rank_classes;
RecTypes recTypes;
int seqno;
const char *path_root;
RecTypeClass record_classes;
NMEM nmem;
+ yaz_timing_t timing;
};
char *user_perm;
char *dbaccesslist;
int errCode;
- zint hits;
char *errString;
+ int partial_result;
#if HAVE_SYS_TIMES_H
struct tms tms1;
struct tms tms2;
zint records_updated;
zint records_deleted;
zint records_processed;
+ zint records_skipped;
char *record_encoding;
yaz_iconv_t iconv_to_utf8;
NMEM nmem_error;
struct zebra_limit *m_limit;
+
+ int (*break_handler_func)(void *client_data);
+ void *break_handler_data;
};
struct rset_key_control *zebra_key_control_create(ZebraHandle zh);
ZEBRA_RES rpn_search_top(ZebraHandle zh, Z_RPNStructure *zs,
- oid_value attributeSet,
+ const Odr_oid *attributeSet,
NMEM stream, NMEM rset_nmem,
Z_SortKeySpecList *sort_sequence,
int num_bases, char **basenames,
zint *approx_limit);
ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
- oid_value attributeset,
+ const Odr_oid *attributeset,
int num_bases, char **basenames,
int *position, int *num_entries, ZebraScanEntry **list,
int *is_partial, RSET limit_set);
const char *term, int length_term, const char *flags,
int preserve_position, int term_type, NMEM rset_nmem,
struct rset_key_control *kctrl, int scope,
- struct ord_list *ol, int reg_type,
+ struct ord_list *ol, const char *index_type,
zint hits_limit, const char *term_ref_id);
void resultSetAddTerm(ZebraHandle zh, ZebraSet s, int reg_type,
ZebraSet resultSetAdd(ZebraHandle zh, const char *name, int ov);
ZebraSet resultSetGet(ZebraHandle zh, const char *name);
ZEBRA_RES resultSetAddRPN(ZebraHandle zh, NMEM m, Z_RPNQuery *rpn,
- int num_bases, char **basenames,
- const char *setname);
+ int num_bases, char **basenames,
+ const char *setname,
+ zint *hits, int *estimated_hit_count);
RSET resultSetRef(ZebraHandle zh, const char *resultSetId);
void resultSetDestroy(ZebraHandle zh, int num_names, char **names,
int *statuses);
NMEM nmem);
void resultSetInvalidate(ZebraHandle zh);
-int zebra_record_fetch(ZebraHandle zh, zint sysno, int score,
- zebra_snippets *hit_snippet, ODR stream,
- oid_value input_format, Z_RecordComposition *comp,
- oid_value *output_format, char **rec_bufp,
- int *rec_lenp, char **basenamep,
- char **addinfo);
+int zebra_record_fetch(ZebraHandle zh, const char *setname,
+ zint sysno, int score,
+ zebra_snippets *hit_snippet, ODR stream,
+ const Odr_oid *input_format, Z_RecordComposition *comp,
+ const Odr_oid **output_format, char **rec_bufp,
+ int *rec_lenp, char **basenamep,
+ char **addinfo);
void extract_get_fname_tmp(ZebraHandle zh, char *fname, int no);
+void extract_snippet(ZebraHandle zh, zebra_snippets *sn,
+ struct ZebraRecStream *stream, RecType rt,
+ void *recTypeClientData);
+
+int zebra_get_rec_snippets(ZebraHandle zh, zint sysno,
+ zebra_snippets *snippets);
+
void zebra_index_merge(ZebraHandle zh);
ZEBRA_RES zebra_buffer_extract_record(ZebraHandle zh,
const char *buf, size_t buf_size,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
- const char *fname,
- int force_update,
- int allow_update);
+ const char *fname);
ZEBRA_RES zebra_extract_record_stream(ZebraHandle zh,
struct ZebraRecStream *stream,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
const char *fname,
- int force_update,
- int allow_update,
RecType recType,
void *recTypeClientData,
int *more);
void zebra_setError(ZebraHandle zh, int code, const char *addinfo);
void zebra_setError_zint(ZebraHandle zh, int code, zint i);
-void zebra_term_untrans_iconv(ZebraHandle zh, NMEM stream, int reg_type,
+void zebra_term_untrans_iconv(ZebraHandle zh, NMEM stream,
+ const char *index_type,
char **dst, const char *src);
ZEBRA_RES zebra_get_hit_vector(ZebraHandle zh, const char *setname, zint sysno);
-void zebra_term_untrans(ZebraHandle zh, int reg_type,
+void zebra_term_untrans(ZebraHandle zh, const char *index_type,
char *dst, const char *src);
ZEBRA_RES zebra_apt_get_ord(ZebraHandle zh,
Z_AttributesPlusTerm *zapt,
- int index_type,
+ const char *index_type,
const char *xpath_use,
- oid_value curAttributeSet,
+ const Odr_oid *curAttributeSet,
int *ord);
ZEBRA_RES zebra_attr_list_get_ord(ZebraHandle zh,
Z_AttributeList *attr_list,
zinfo_index_category_t cat,
- int index_type,
- oid_value curAttributeSet,
+ const char *index_type,
+ const Odr_oid *curAttributeSet,
int *ord);
ZEBRA_RES zebra_sort_get_ord(ZebraHandle zh,
struct rpn_char_map_info
{
- ZebraMaps zm;
+ zebra_map_t zm;
int reg_type;
};
-void rpn_char_map_prepare(struct zebra_register *reg, int reg_type,
+void rpn_char_map_prepare(struct zebra_register *reg, zebra_map_t zm,
struct rpn_char_map_info *map_info);
ZEBRA_RES zapt_term_to_utf8(ZebraHandle zh, Z_AttributesPlusTerm *zapt,
char *termz);
+void zebra_set_partial_result(ZebraHandle zh);
+
int zebra_check_res(Res res);
#define FIRST_IN_FIELD_STR "\001^"
#define FIRST_IN_FIELD_CHAR 1
#define FIRST_IN_FIELD_LEN 2
+ZEBRA_RES zebra_term_limits_APT(ZebraHandle zh,
+ Z_AttributesPlusTerm *zapt,
+ zint *hits_limit_value,
+ const char **term_ref_id_str,
+ NMEM nmem);
+
YAZ_END_CDECL
#endif