30 #include <sys/times.h>
34 #include <yaz/timing.h>
53 #define ISAM_DEFAULT "b"
98 #define FNAME_DICT "dict"
99 #define FNAME_ISAM "isam"
100 #define FNAME_ISAMC "isamc"
101 #define FNAME_ISAMS "isams"
102 #define FNAME_CONFIG "zebra.cfg"
104 #define GMATCH_DICT "gmatch"
105 #define FMATCH_DICT "fmatch%d"
109 #define FNAME_MAIN_LOCK "zebraidx.LCK"
110 #define FNAME_COMMIT_LOCK "zebracmt.LCK"
111 #define FNAME_ORG_LOCK "zebraorg.LCK"
112 #define FNAME_TOUCH_TIME "zebraidx.time"
253 int (**filter_func)(
const void *buf,
void *data),
260 const Odr_oid *attributeSet,
zint hits_limit,
261 NMEM stream, NMEM rset_nmem,
262 Z_SortKeySpecList *sort_sequence,
263 int num_bases,
const char **basenames,
270 const Odr_oid *attributeset,
271 int num_bases,
char **basenames,
273 int *is_partial,
const char *set_name);
276 const char *term,
int length_term,
const char *flags,
277 int preserve_position,
int term_type, NMEM rset_nmem,
279 struct ord_list *ol,
const char *index_type,
280 zint hits_limit,
const char *term_ref_id);
283 const char ***basenames,
int *num_bases);
286 const char *db,
const char *index_name,
291 int num_bases,
char **basenames,
293 zint *hits,
int *estimated_hit_count);
298 int num_input_setnames,
const char **input_setnames,
299 const char *output_setname,
300 Z_SortKeySpecList *sort_sequence,
int *sort_status);
303 Z_SortKeySpecList *sort_sequence,
310 zint sysno,
int score,
312 const Odr_oid *input_format, Z_RecordComposition *comp,
313 const Odr_oid **output_format,
char **rec_bufp,
314 int *rec_lenp,
char **basenamep,
322 void *recTypeClientData);
330 const char *buf,
size_t buf_size,
332 const char *recordType,
334 const char *match_criteria,
339 const char *buf,
size_t sz);
341 int fd, off_t start_offset);
361 int compact_flag,
Res res);
367 const char *index_type,
368 char **dst,
const char *src);
371 char **dst,
const char *src);
376 char *dst,
const char *src);
379 Z_AttributesPlusTerm *zapt,
380 const char *index_type,
381 const char *xpath_use,
382 const Odr_oid *curAttributeSet,
386 Z_AttributeList *attr_list,
388 const char *index_type,
389 const Odr_oid *curAttributeSet,
393 Z_SortAttributes *sortAttributes,
419 #define FIRST_IN_FIELD_STR "\001^"
420 #define FIRST_IN_FIELD_CHAR 1
421 #define FIRST_IN_FIELD_LEN 2
424 Z_AttributesPlusTerm *zapt,
425 zint *hits_limit_value,
426 const char **term_ref_id_str,
432 zint *sysnos,
int *no_sysnos);
442 const char *str,
size_t slen, NMEM nmem,
int level);
int zebra_record_fetch(ZebraHandle zh, const char *setname, zint sysno, int score, ODR stream, const Odr_oid *input_format, Z_RecordComposition *comp, const Odr_oid **output_format, char **rec_bufp, int *rec_lenp, char **basenamep, WRBUF addinfo_w)
void zebra_term_untrans_iconv2(ZebraHandle zh, NMEM stream, char **dst, const char *src)
ZEBRA_RES zebra_attr_list_get_ord(ZebraHandle zh, Z_AttributeList *attr_list, zinfo_index_category_t cat, const char *index_type, const Odr_oid *curAttributeSet, int *ord)
ISAMS_M * key_isams_m(Res res, ISAMS_M *me)
struct dirs_info * dirs_fopen(Dict dict, const char *path, int rw)
ZEBRA_RES zebra_result_recid_to_sysno(ZebraHandle zh, const char *setname, zint recid, zint *sysnos, int *no_sysnos)
void zebra_it_key_str_dump(ZebraHandle zh, struct it_key *key, const char *str, size_t slen, NMEM nmem, int level)
ZebraSet resultSetAdd(ZebraHandle zh, const char *name, int ov)
Dict dict_open_res(BFiles bfs, const char *name, int cache, int rw, int compact_flag, Res res)
struct zebra_rank_class * ZebraRankClass
void resultSetDestroy(ZebraHandle zh, int num_names, char **names, int *statuses)
ZEBRA_RES zebra_remove_file_match(ZebraHandle zh)
void zebra_lock_prefix(Res res, char *dst)
void zebra_limit_for_rset(struct zebra_limit *zl, int(**filter_func)(const void *buf, void *data), void(**filter_destroy)(void *data), void **filter_data)
ZEBRA_RES zebra_end_read(ZebraHandle zh)
RSET resultSetRef(ZebraHandle zh, const char *resultSetId)
ZEBRA_RES zebra_sort_get_ord(ZebraHandle zh, Z_SortAttributes *sortAttributes, int *ord, int *numerical)
ZEBRA_RES zebra_update_file_match(ZebraHandle zh, const char *path)
void zebra_set_partial_result(ZebraHandle zh)
ZEBRA_RES zebra_update_from_path(ZebraHandle zh, const char *path, enum zebra_recctrl_action_t action)
void rpn_char_map_prepare(struct zebra_register *reg, zebra_map_t zm, struct rpn_char_map_info *map_info)
void dirs_mkdir(struct dirs_info *p, const char *src, time_t mtime)
int zebra_check_res(Res res)
void dirs_rmdir(struct dirs_info *p, const char *src)
ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, const Odr_oid *attributeset, int num_bases, char **basenames, int *position, int *num_entries, ZebraScanEntry **list, int *is_partial, const char *set_name)
struct dirs_entry * dirs_last(struct dirs_info *p)
ZEBRA_RES resultSetGetBaseNames(ZebraHandle zh, const char *setname, const char ***basenames, int *num_bases)
void dirs_add(struct dirs_info *p, const char *src, zint sysno, time_t mtime)
ZEBRA_RES resultSetRank(ZebraHandle zh, ZebraSet zebraSet, RSET rset, NMEM nmem)
struct dir_entry * dir_open(const char *rep, const char *base, int follow_links)
int zebra_term_untrans(ZebraHandle zh, const char *index_type, char *dst, const char *src)
void zebra_create_stream_fd(struct ZebraRecStream *stream, int fd, off_t start_offset)
ZEBRA_RES zebra_rec_keys_to_snippets(ZebraHandle zh, zebra_rec_keys_t reckeys, zebra_snippets *snippets)
void zebra_count_set(ZebraHandle zh, RSET rset, zint *count, zint approx_limit)
ZEBRA_RES zapt_term_to_utf8(ZebraHandle zh, Z_AttributesPlusTerm *zapt, char *termz)
void repositoryUpdate(ZebraHandle zh, const char *path)
void extract_get_fname_tmp(ZebraHandle zh, char *fname, size_t fname_size, int no)
void zebra_create_stream_mem(struct ZebraRecStream *stream, const char *buf, size_t sz)
void zebra_setError(ZebraHandle zh, int code, const char *addinfo)
ZEBRA_RES resultSetSortSingle(ZebraHandle zh, NMEM nmem, ZebraSet sset, RSET rset, Z_SortKeySpecList *sort_sequence, int *sort_status)
void zebra_setError_zint(ZebraHandle zh, int code, zint i)
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)
void extract_snippet(ZebraHandle zh, zebra_snippets *sn, struct ZebraRecStream *stream, RecType rt, void *recTypeClientData)
ZEBRA_RES zebra_extract_explain(void *handle, Record rec, data1_node *n)
void inv_prstat(ZebraHandle zh)
ZEBRA_RES zebra_begin_read(ZebraHandle zh)
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, const char *index_type, zint hits_limit, const char *term_ref_id)
RSET zebra_create_rset_isam(ZebraHandle zh, NMEM rset_nmem, struct rset_key_control *kctl, int scope, ISAM_P pos, TERMID termid)
void dirs_free(struct dirs_info **pp)
struct dirs_entry * dirs_read(struct dirs_info *p)
ISAMC_M * key_isamc_m(Res res, ISAMC_M *me)
struct dirs_info * dirs_open(Dict dict, const char *rep, int rw)
void print_rec_keys(ZebraHandle zh, zebra_rec_keys_t reckeys)
ZEBRA_RES zebra_get_hit_vector(ZebraHandle zh, const char *setname, zint sysno)
ZEBRA_RES zebra_buffer_extract_record(ZebraHandle zh, const char *buf, size_t buf_size, enum zebra_recctrl_action_t action, const char *recordType, zint *sysno, const char *match_criteria, const char *fname)
void inv_compact(BFiles bfs)
void repositoryAdd(ZebraHandle zh, const char *path)
ZEBRA_RES zebra_term_limits_APT(ZebraHandle zh, Z_AttributesPlusTerm *zapt, zint *hits_limit_value, const char **term_ref_id_str, NMEM nmem)
void dir_sort(struct dir_entry *e)
void resultSetAddTerm(ZebraHandle zh, ZebraSet s, int reg_type, const char *db, const char *index_name, const char *term)
ZEBRA_RES rpn_get_top_approx_limit(ZebraHandle zh, Z_RPNStructure *zs, zint *approx_limit)
struct zebra_set * ZebraSet
ZEBRA_RES rpn_search_top(ZebraHandle zh, Z_RPNStructure *zs, const Odr_oid *attributeSet, zint hits_limit, NMEM stream, NMEM rset_nmem, Z_SortKeySpecList *sort_sequence, int num_bases, const char **basenames, RSET *result_set)
void zebra_index_merge(ZebraHandle zh)
ZEBRA_RES zebra_extract_file(ZebraHandle zh, zint *sysno, const char *fname, enum zebra_recctrl_action_t action)
ZEBRA_RES zebra_apt_get_ord(ZebraHandle zh, Z_AttributesPlusTerm *zapt, const char *index_type, const char *xpath_use, const Odr_oid *curAttributeSet, int *ord)
void repositoryDelete(ZebraHandle zh, const char *path)
void getFnameTmp(Res res, char *fname, int no)
void key_input(ZebraHandle zh, int nkeys, int cache, Res res)
ZEBRA_RES resultSetAddRPN(ZebraHandle zh, NMEM m, Z_RPNQuery *rpn, int num_bases, char **basenames, const char *setname, zint *hits, int *estimated_hit_count)
int zebra_term_untrans_iconv(ZebraHandle zh, NMEM stream, const char *index_type, char **dst, const char *src)
void resultSetInvalidate(ZebraHandle zh)
ZebraSet resultSetGet(ZebraHandle zh, const char *name)
void dirs_del(struct dirs_info *p, const char *src)
int zebra_file_stat(const char *file_name, struct stat *buf, int follow_links)
int zebra_get_rec_snippets(ZebraHandle zh, zint sysno, zebra_snippets *snippets)
struct rset_key_control * zebra_key_control_create(ZebraHandle zh)
void zebra_limit_destroy(struct zebra_limit *zl)
void repositoryShow(ZebraHandle zh, const char *path)
ZEBRA_RES zebra_snippets_hit_vector(ZebraHandle zh, const char *setname, zint sysno, zebra_snippets *snippets)
struct zebra_limit * zebra_limit_create(int exclude_flag, zint *ids)
void dir_free(struct dir_entry **e_p)
static void filter_destroy(void *clientData)
struct term_set_entry * next
struct term_set_entry * last
struct term_set_entry * first
struct rank_control * control
struct zebra_rank_class * next
char * server_path_prefix
zebra_rec_keys_t sortKeys
zebra_key_block_t key_block
ZebraRankClass rank_classes
zebra_sort_index_t sort_index
Zebra_mutex_cond session_lock
struct zebra_session * sessions
RecTypeClass record_classes
struct zebra_register * regs
struct zebra_session * next
struct zebra_register * reg
char * xadmin_databaseName
struct zebra_service * service
const char * m_record_type
ZebraLockHandle lock_shadow
void * break_handler_data
ZebraLockHandle lock_normal
struct zebra_limit * m_limit
int(* break_handler_func)(void *client_data)
yaz_iconv_t iconv_from_utf8
yaz_iconv_t iconv_to_utf8
short ZEBRA_RES
Common return type for Zebra API.