X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Findex.h;h=07392a16f37e963abf7842379fbd69ec1336a832;hb=7786ecc8ce35a72145aeb9c098a4cfcc9d3c4822;hp=cf13c2d35d515160b53ee32fc143d141d945c13a;hpb=ca39c711e9398043092cceeb3b4a7d8a0db1c0d8;p=idzebra-moved-to-github.git diff --git a/index/index.h b/index/index.h index cf13c2d..07392a1 100644 --- a/index/index.h +++ b/index/index.h @@ -1,5 +1,5 @@ -/* $Id: index.h,v 1.182 2006-11-21 14:32:38 adam Exp $ - Copyright (C) 1995-2006 +/* $Id: index.h,v 1.197 2007-04-16 08:44:31 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif #include +#include #include #include #include @@ -66,7 +67,7 @@ struct dir_entry { struct dirs_entry { enum dirsKind kind; char path[256]; - SYSNO sysno; + zint sysno; time_t mtime; }; @@ -78,12 +79,12 @@ struct dirs_entry *dirs_read(struct dirs_info *p); struct dirs_entry *dirs_last(struct dirs_info *p); void dirs_mkdir(struct dirs_info *p, const char *src, time_t mtime); void dirs_rmdir(struct dirs_info *p, const char *src); -void dirs_add(struct dirs_info *p, const char *src, SYSNO sysno, time_t mtime); +void dirs_add(struct dirs_info *p, const char *src, zint sysno, time_t mtime); void dirs_del(struct dirs_info *p, const char *src); void dirs_free(struct dirs_info **pp); struct dir_entry *dir_open(const char *rep, const char *base, - int follow_links); + int follow_links); void dir_sort(struct dir_entry *e); void dir_free(struct dir_entry **e_p); @@ -107,17 +108,6 @@ ISAMC_M *key_isamc_m(Res res, ISAMC_M *me); #define GMATCH_DICT "gmatch" #define FMATCH_DICT "fmatch%d" -struct strtab *strtab_mk(void); -int strtab_src(struct strtab *t, const char *name, void ***infop); -void strtab_del(struct strtab *t, - void (*func)(const char *name, void *info, void *data), - void *data); - -void zebraIndexLockMsg(ZebraHandle zh, const char *str); -void zebraIndexUnlock(ZebraHandle zh); -int zebraIndexLock(BFiles bfs, ZebraHandle zh, int commitNow, const char *rval); -int zebraIndexWait(ZebraHandle zh, int commitPhase); - void zebra_lock_prefix(Res res, char *dst); #define FNAME_MAIN_LOCK "zebraidx.LCK" @@ -145,7 +135,7 @@ struct zebra_register { 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; @@ -178,6 +168,7 @@ struct zebra_service { const char *path_root; RecTypeClass record_classes; NMEM nmem; + yaz_timing_t timing; }; @@ -207,8 +198,8 @@ struct zebra_session { 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; @@ -222,6 +213,7 @@ struct zebra_session { zint records_updated; zint records_deleted; zint records_processed; + zint records_skipped; char *record_encoding; yaz_iconv_t iconv_to_utf8; @@ -242,6 +234,9 @@ struct zebra_session { NMEM nmem_error; struct zebra_limit *m_limit; + + int (*break_handler_func)(void *client_data); + void *break_handler_data; }; @@ -266,14 +261,17 @@ void zebra_limit_for_rset(struct zebra_limit *zl, struct rset_key_control *zebra_key_control_create(ZebraHandle zh); ZEBRA_RES rpn_search_top(ZebraHandle zh, Z_RPNStructure *zs, - oid_value attributeSet, + const int *attributeSet, NMEM stream, NMEM rset_nmem, Z_SortKeySpecList *sort_sequence, int num_bases, char **basenames, RSET *result_set); +ZEBRA_RES rpn_get_top_approx_limit(ZebraHandle zh, Z_RPNStructure *zs, + zint *approx_limit); + ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, - oid_value attributeset, + const int *attributeset, int num_bases, char **basenames, int *position, int *num_entries, ZebraScanEntry **list, int *is_partial, RSET limit_set); @@ -291,8 +289,9 @@ 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); @@ -308,12 +307,12 @@ ZEBRA_RES resultSetRank(ZebraHandle zh, ZebraSet zebraSet, RSET rset, NMEM nmem); void resultSetInvalidate(ZebraHandle zh); -int zebra_record_fetch(ZebraHandle zh, SYSNO 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, zint sysno, int score, + zebra_snippets *hit_snippet, ODR stream, + const int *input_format, Z_RecordComposition *comp, + const int **output_format, char **rec_bufp, + int *rec_lenp, char **basenamep, + char **addinfo); void extract_get_fname_tmp(ZebraHandle zh, char *fname, int no); @@ -321,27 +320,24 @@ 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, - SYSNO *sysno, + 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, - SYSNO *sysno, + zint *sysno, const char *match_criteria, const char *fname, - int force_update, - int allow_update, RecType recType, - void *recTypeClientData); + void *recTypeClientData, + int *more); YAZ_EXPORT void zebra_create_stream_mem(struct ZebraRecStream *stream, const char *buf, size_t sz); @@ -356,7 +352,7 @@ ZEBRA_RES zebra_snippets_hit_vector(ZebraHandle zh, const char *setname, ZEBRA_RES zebra_extract_explain(void *handle, Record rec, data1_node *n); -ZEBRA_RES zebra_extract_file(ZebraHandle zh, SYSNO *sysno, const char *fname, +ZEBRA_RES zebra_extract_file(ZebraHandle zh, zint *sysno, const char *fname, int deleteFlag); ZEBRA_RES zebra_begin_read(ZebraHandle zh); @@ -383,14 +379,14 @@ ZEBRA_RES zebra_apt_get_ord(ZebraHandle zh, Z_AttributesPlusTerm *zapt, int index_type, const char *xpath_use, - oid_value curAttributeSet, + const int *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 int *curAttributeSet, int *ord); ZEBRA_RES zebra_sort_get_ord(ZebraHandle zh, @@ -416,6 +412,10 @@ 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