-/* $Id: zebraapi.c,v 1.122 2004-08-04 09:05:17 adam Exp $
+/* $Id: zebraapi.c,v 1.120.2.1 2004-09-09 10:43:18 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
reg->keys.buf_max = 0;
reg->keys.buf = 0;
-#if IT_KEY_NEW
- reg->keys.codec_handle = iscz1_start();
-#endif
-
reg->sortKeys.buf = 0;
reg->sortKeys.buf_max = 0;
reg->matchDict = 0;
reg->isam = 0;
reg->isamc = 0;
+ reg->isamd = 0;
reg->isamb = 0;
reg->zei = 0;
reg->matchDict = 0;
return 0;
}
}
+ if (res_get_match (res, "isam", "d", ISAM_DEFAULT))
+ {
+ struct ISAMD_M_s isamd_m;
+
+ if (!(reg->isamd = isamd_open (reg->bfs, FNAME_ISAMD,
+ rw, key_isamd_m(res, &isamd_m))))
+ {
+ logf (LOG_WARN, "isamd_open");
+ return 0;
+ }
+ }
if (res_get_match (res, "isam", "b", ISAM_DEFAULT))
{
struct ISAMC_M_s isamc_m;
is_close (reg->isam);
if (reg->isamc)
isc_close (reg->isamc);
+ if (reg->isamd)
+ isamd_close (reg->isamd);
if (reg->isamb)
isamb_close (reg->isamb);
rec_close (®->records);
xfree (reg->sortKeys.buf);
xfree (reg->keys.buf);
-#if IT_KEY_NEW
- if (reg->keys.codec_handle)
- iscz1_stop(reg->keys.codec_handle);
-#endif
xfree (reg->key_buf);
xfree (reg->name);
int zebra_admin_import_segment (ZebraHandle zh, Z_Segment *segment)
{
- SYSNO sysno;
+ int sysno;
int i;
ASSERTZH;
yaz_log(LOG_API,"zebra_admin_import_segment");
/* 3 = delete. Fail if does not exist */
/* 4 = update. Insert/replace */
{
- SYSNO sysno = 0;
+ int sysno = 0;
char *rinfo = 0;
char recid_z[256];
ASSERTZH;
bfs = bfs_create (res_get (zh->service->global_res, "register"),
zh->path_reg);
+ if (!bfs)
+ return -1;
if (rval && *rval)
bf_cache (bfs, rval);
int zebra_add_record(ZebraHandle zh,
const char *buf, int buf_size)
{
- SYSNO sysno = 0;
+ int sysno = 0;
return zebra_update_record(zh, 0, &sysno, 0, 0, buf, buf_size, 0);
}
int zebra_insert_record (ZebraHandle zh,
const char *recordType,
- SYSNO *sysno, const char *match, const char *fname,
+ int *sysno, const char *match, const char *fname,
const char *buf, int buf_size, int force_update)
{
int res;
- yaz_log(LOG_API,"zebra_insert_record sysno=" ZINT_FORMAT, *sysno);
+ yaz_log(LOG_API,"zebra_insert_record sysno=%d", *sysno);
if (buf_size < 1) buf_size = strlen(buf);
int zebra_update_record (ZebraHandle zh,
const char *recordType,
- SYSNO* sysno, const char *match, const char *fname,
+ int* sysno, const char *match, const char *fname,
const char *buf, int buf_size,
int force_update)
{
int res;
- yaz_log(LOG_API,"zebra_update_record sysno=" ZINT_FORMAT, *sysno);
+ yaz_log(LOG_API,"zebra_update_record sysno=%d", *sysno);
if (buf_size < 1) buf_size = strlen(buf);
match, fname,
force_update,
1); /* allow_update */
+ yaz_log(LOG_LOG, "zebra_update_record returned res=%d", res);
zebra_end_trans(zh);
return res;
}
int zebra_delete_record (ZebraHandle zh,
const char *recordType,
- SYSNO *sysno, const char *match, const char *fname,
+ int *sysno, const char *match, const char *fname,
const char *buf, int buf_size,
int force_update)
{
int res;
- yaz_log(LOG_API,"zebra_delete_record sysno=" ZINT_FORMAT, *sysno);
+ yaz_log(LOG_API,"zebra_delete_record sysno=%d", *sysno);
if (buf_size < 1) buf_size = strlen(buf);