-/* $Id: index.h,v 1.136 2005-05-03 09:11:34 adam Exp $
+/* $Id: index.h,v 1.152 2005-10-20 18:28:10 quinn Exp $
Copyright (C) 1995-2005
Index Data ApS
#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];
void getFnameTmp (Res res, char *fname, int no);
struct dirs_info *dirs_open (Dict dict, const char *rep, int rw);
-struct dirs_info *dirs_fopen (Dict dict, const char *path);
+struct dirs_info *dirs_fopen (Dict dict, const char *path, int rw);
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 *codec_handle;
};
+#if NATTR
+
+#else
struct sortKeys {
int buf_used;
int buf_max;
char *buf;
};
+#endif
struct zebra_register {
char *name;
int active; /* 0=shutdown, 1=enabled and inactive, 2=activated */
struct recKeys keys;
-#if 1
- struct sortKeys sortKeys;
+#if NATTR
+ struct recKeys sortKeys;
#else
- struct sortKey *sortKeys;
+ struct sortKeys sortKeys;
#endif
char **key_buf;
size_t ptr_top;
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;
char **basenames;
int num_basenames;
+ zint approx_limit;
char *reg_name;
char *path_reg;
int destroyed;
ZebraSet sets;
Res res;
+ Res session_res;
char *user_perm;
+ char *dbaccesslist;
int errCode;
zint hits;
char *errString;
#endif
int shadow_enable;
+ int m_staticrank;
+
zint records_inserted;
zint records_updated;
zint records_deleted;
void *store_data_buf;
size_t store_data_size;
+ NMEM nmem_error;
struct zebra_limit *m_limit;
};
* 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);
};
int *position, int *num_entries, ZebraScanEntry **list,
int *is_partial, RSET limit_set, int return_zero);
-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);
+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,
+ zint hits_limit, const char *term_ref_id);
void resultSetAddTerm (ZebraHandle zh, ZebraSet s, int reg_type,
const char *db, int set,
RSET resultSetRef (ZebraHandle zh, const char *resultSetId);
void resultSetDestroy (ZebraHandle zh, int num_names, char **names,
int *statuses);
-void resultSetSort (ZebraHandle zh, NMEM nmem,
- int num_input_setnames, const char **input_setnames,
- const char *output_setname,
- Z_SortKeySpecList *sort_sequence, int *sort_status);
-void resultSetSortSingle (ZebraHandle zh, NMEM nmem,
- ZebraSet sset, RSET rset,
- Z_SortKeySpecList *sort_sequence, int *sort_status);
-void resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset, NMEM nmem);
+ZEBRA_RES resultSetSort (ZebraHandle zh, NMEM nmem,
+ int num_input_setnames, const char **input_setnames,
+ const char *output_setname,
+ Z_SortKeySpecList *sort_sequence, int *sort_status);
+ZEBRA_RES resultSetSortSingle (ZebraHandle zh, NMEM nmem,
+ ZebraSet sset, RSET rset,
+ Z_SortKeySpecList *sort_sequence,
+ int *sort_status);
+ZEBRA_RES resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset,
+ NMEM nmem);
void resultSetInvalidate (ZebraHandle zh);
int zebra_server_lock_init (ZebraService zh);
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, ODR stream,
+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,
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,
+ 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, struct recKeys *reckeys,
+ zint staticrank);
+#if NATTR
+void extract_flushSortKeys (ZebraHandle zh, SYSNO sysno,
+ int cmd, struct recKeys *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);
Dict dict_open_res (BFiles bfs, const char *name, int cache, int rw,
int compact_flag, Res res);
+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,
+ 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,
+ char *dst, const char *src);
+
YAZ_END_CDECL
#endif