X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=3f80807b1af3f8a3c8ed677127dbdcf048d71f7c;hb=4c112f15503aebed494fab8aa5296c3661bfb31c;hp=12d28ac9433ddfd06a05ac081356997aecdc9d5b;hpb=ca39c711e9398043092cceeb3b4a7d8a0db1c0d8;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index 12d28ac..3f80807 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.233 2006-11-21 14:32:38 adam Exp $ +/* $Id: zebraapi.c,v 1.236 2006-12-05 09:26:37 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -174,12 +174,12 @@ ZebraHandle zebra_open(ZebraService zs, Res res) return zh; } -ZebraService zebra_start (const char *configName) +ZebraService zebra_start(const char *configName) { return zebra_start_res(configName, 0, 0); } -ZebraService zebra_start_res (const char *configName, Res def_res, Res over_res) +ZebraService zebra_start_res(const char *configName, Res def_res, Res over_res) { Res res; @@ -348,8 +348,7 @@ struct zebra_register *zebra_register_open(ZebraService zs, const char *name, } getcwd(cwd, sizeof(cwd)-1); - profilePath = res_get_def(res, "profilePath", DEFAULT_PROFILE_PATH); - yaz_log(YLOG_DEBUG, "profilePath=%s cwd=%s", profilePath, cwd); + profilePath = res_get_def(res, "profilePath", 0); data1_set_tabpath (reg->dh, profilePath); data1_set_tabroot (reg->dh, reg_path); @@ -1066,9 +1065,12 @@ ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream, int len = 0; zebra_snippets *hit_snippet = zebra_snippets_create(); + /* we disable hit snippets for now. It does not work well + and it slows retrieval down a lot */ +#if 0 zebra_snippets_hit_vector(zh, setname, poset[i].sysno, hit_snippet); - +#endif recs[i].errCode = zebra_record_fetch(zh, poset[i].sysno, poset[i].score, hit_snippet, @@ -1316,7 +1318,7 @@ ZEBRA_RES zebra_admin_import_end (ZebraHandle zh) ZEBRA_RES zebra_admin_import_segment (ZebraHandle zh, Z_Segment *segment) { ZEBRA_RES res = ZEBRA_OK; - SYSNO sysno; + zint sysno; int i; ZEBRA_CHECK_HANDLE(zh); yaz_log(log_level, "zebra_admin_import_segment"); @@ -1358,7 +1360,7 @@ ZEBRA_RES zebra_admin_exchange_record(ZebraHandle zh, /* 4 = update. Insert/replace */ { ZEBRA_RES res; - SYSNO sysno = 0; + zint sysno = 0; char *rinfo = 0; char recid_z[256]; int db_ord; @@ -2236,7 +2238,7 @@ ZEBRA_RES zebra_add_record(ZebraHandle zh, ZEBRA_RES zebra_insert_record(ZebraHandle zh, const char *recordType, - SYSNO *sysno, const char *match, + zint *sysno, const char *match, const char *fname, const char *buf, int buf_size, int force_update) { @@ -2267,12 +2269,12 @@ ZEBRA_RES zebra_insert_record(ZebraHandle zh, return res; } -ZEBRA_RES zebra_update_record (ZebraHandle zh, - const char *recordType, - SYSNO* sysno, const char *match, - const char *fname, - const char *buf, int buf_size, - int force_update) +ZEBRA_RES zebra_update_record(ZebraHandle zh, + const char *recordType, + zint *sysno, const char *match, + const char *fname, + const char *buf, int buf_size, + int force_update) { ZEBRA_RES res; @@ -2304,12 +2306,12 @@ ZEBRA_RES zebra_update_record (ZebraHandle zh, return res; } -ZEBRA_RES zebra_delete_record (ZebraHandle zh, - const char *recordType, - SYSNO *sysno, const char *match, - const char *fname, - const char *buf, int buf_size, - int force_update) +ZEBRA_RES zebra_delete_record(ZebraHandle zh, + const char *recordType, + zint *sysno, const char *match, + const char *fname, + const char *buf, int buf_size, + int force_update) { ZEBRA_RES res; @@ -2466,11 +2468,11 @@ void zebra_setError_zint(ZebraHandle zh, int code, zint i) zh->errString = nmem_strdup(zh->nmem_error, vstr); } -void zebra_lock_prefix (Res res, char *path) +void zebra_lock_prefix(Res res, char *path) { const char *lock_dir = res_get_def (res, "lockDir", ""); - - strcpy (path, lock_dir); + + strcpy(path, lock_dir); if (*path && path[strlen(path)-1] != '/') strcat (path, "/"); }