X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Findex.h;h=7bc5c3c25a8fddb7ce0debfa0fda11a49922a707;hb=985e74909c7e486edbb5220522796ec66c735504;hp=95371fa78d1763f39552618dac58a9b1876fd67d;hpb=7a2d0f25682890bde5d8f2883d6020df2ed0b365;p=idzebra-moved-to-github.git diff --git a/index/index.h b/index/index.h index 95371fa..7bc5c3c 100644 --- a/index/index.h +++ b/index/index.h @@ -1,4 +1,4 @@ -/* $Id: index.h,v 1.142 2005-06-07 14:53:39 adam Exp $ +/* $Id: index.h,v 1.154 2005-10-28 09:22:50 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -54,7 +54,7 @@ YAZ_BEGIN_CDECL #define IT_MAX_WORD 256 -#define IT_KEY_LEVEL_MAX 4 +#define IT_KEY_LEVEL_MAX 5 struct it_key { int len; zint mem[IT_KEY_LEVEL_MAX]; @@ -192,18 +192,17 @@ typedef struct zebra_rank_class { struct zebra_rank_class *next; } *ZebraRankClass; -struct recKeys { - int buf_used; - int buf_max; - char *buf; - void *codec_handle; -}; +#include "reckeys.h" +#if NATTR + +#else struct sortKeys { int buf_used; int buf_max; char *buf; }; +#endif struct zebra_register { char *name; @@ -230,11 +229,12 @@ struct zebra_register { int stop_flag; int active; /* 0=shutdown, 1=enabled and inactive, 2=activated */ - struct recKeys keys; -#if 1 - struct sortKeys sortKeys; + zebra_rec_keys_t keys; + +#if NATTR + zebra_rec_keys_t sortKeys; #else - struct sortKey *sortKeys; + struct sortKeys sortKeys; #endif char **key_buf; size_t ptr_top; @@ -246,11 +246,11 @@ struct zebra_register { struct zebra_service { int stop_flag; Res global_res; - char *configName; struct zebra_session *sessions; struct zebra_register *regs; Zebra_mutex_cond session_lock; Passwd_db passwd_db; + Res dbaccess; const char *path_root; RecTypeClass record_classes; NMEM nmem; @@ -266,6 +266,7 @@ struct zebra_session { char **basenames; int num_basenames; + zint approx_limit; char *reg_name; char *path_reg; @@ -278,7 +279,9 @@ struct zebra_session { int destroyed; ZebraSet sets; Res res; + Res session_res; char *user_perm; + char *dbaccesslist; int errCode; zint hits; char *errString; @@ -288,6 +291,8 @@ struct zebra_session { #endif int shadow_enable; + int m_staticrank; + zint records_inserted; zint records_updated; zint records_deleted; @@ -327,7 +332,8 @@ struct rank_control { * int rssize; // number of records in result set (estimate?) */ void (*end)(struct zebra_register *reg, void *set_handle); - int (*calc)(void *set_handle, zint sysno); + int (*calc)(void *set_handle, zint sysno, zint staticrank, + int *stop_flag); void (*add)(void *set_handle, int seqno, TERMID term); }; @@ -368,7 +374,8 @@ RSET rset_trunc(ZebraHandle zh, ISAM_P *isam_p, int no, 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, int reg_type, + zint hits_limit, const char *term_ref_id); void resultSetAddTerm (ZebraHandle zh, ZebraSet s, int reg_type, const char *db, int set, @@ -412,9 +419,9 @@ void zebraRankDestroy (struct zebra_register *reg); int att_getentbyatt(ZebraHandle zh, attent *res, oid_value set, int att, const char *sattr); -extern struct rank_control *rank1_class; -extern struct rank_control *rankzv_class; -extern struct rank_control *rankliv_class; +extern struct rank_control *rank_1_class; +extern struct rank_control *rank_zv_class; +extern struct rank_control *rank_static_class; int zebra_record_fetch (ZebraHandle zh, SYSNO sysno, int score, zebra_snippets *hit_snippet, ODR stream, @@ -465,16 +472,23 @@ off_t zebra_record_int_tell (void *fh); int zebra_record_int_read (void *fh, char *buf, size_t count); void zebra_record_int_end (void *fh, off_t offset); -void print_rec_keys(ZebraHandle zh, struct recKeys *reckeys); -ZEBRA_RES zebra_snippets_rec_keys(ZebraHandle zh, struct recKeys *reckeys, +void print_rec_keys(ZebraHandle zh, zebra_rec_keys_t reckeys); + +ZEBRA_RES zebra_snippets_rec_keys(ZebraHandle zh, zebra_rec_keys_t reckeys, zebra_snippets *snippets); ZEBRA_RES zebra_snippets_hit_vector(ZebraHandle zh, const char *setname, zint sysno, zebra_snippets *snippets); void extract_flushRecordKeys (ZebraHandle zh, SYSNO sysno, - int cmd, struct recKeys *reckeys); + int cmd, zebra_rec_keys_t reckeys, + zint staticrank); +#if NATTR +void extract_flushSortKeys (ZebraHandle zh, SYSNO sysno, + int cmd, zebra_rec_keys_t skp); +#else void extract_flushSortKeys (ZebraHandle zh, SYSNO sysno, int cmd, struct sortKeys *skp); +#endif void extract_schema_add (struct recExtractCtrl *p, Odr_oid *oid); void extract_token_add (RecWord *p); int explain_extract (void *handle, Record rec, data1_node *n); @@ -507,6 +521,9 @@ void zebra_term_untrans_iconv(ZebraHandle zh, NMEM stream, int reg_type, ZEBRA_RES zebra_get_hit_vector(ZebraHandle zh, const char *setname, zint sysno); +void zebra_term_untrans(ZebraHandle zh, int reg_type, + char *dst, const char *src); + YAZ_END_CDECL #endif