dnl Zebra, Index Data ApS, 1995-2005
-dnl $Id: configure.in,v 1.124 2005-05-24 20:39:02 adam Exp $
+dnl $Id: configure.in,v 1.125 2005-06-13 10:29:20 adam Exp $
dnl
AC_INIT(include/idzebra/version.h)
AM_INIT_AUTOMAKE(idzebra,1.4.0)
fi
dnl
dnl ------ YAZ
-YAZ_INIT($yazflag,2.1.5)
+YAZ_INIT($yazflag,2.1.9)
YAZ_DOC
dnl ----- libXSLT
AC_SUBST(XSLT_LIBS)
-/* $Id: zebraapi.c,v 1.176 2005-06-10 10:55:18 adam Exp $
+/* $Id: zebraapi.c,v 1.177 2005-06-13 10:29:20 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
#include <charmap.h>
#include <idzebra/api.h>
+#define DEFAULT_APPROX_LIMIT 2000000000
+
/* simple asserts to validate the most essential input args */
#define ASSERTZH assert(zh && zh->service)
#define ASSERTZHRES assert(zh && zh->service && zh->res)
zh->num_basenames = 0;
zh->basenames = 0;
- zh->approx_limit = 1000000000;
+ zh->approx_limit = DEFAULT_APPROX_LIMIT;
zh->trans_no = 0;
zh->trans_w_no = 0;
{
int page_size = 4096;
char resource_str[200];
- const char *v;
sprintf (resource_str, "dict.%.100s.pagesize", name);
assert(bfs);
assert(name);
- v = res_get(res, resource_str);
- if (v)
- {
- page_size = atoi(v);
+ if (res_get_int(res, resource_str, &page_size) == ZEBRA_OK)
yaz_log(YLOG_LOG, "Using custom dictionary page size %d for %s",
page_size, name);
- }
return dict_open(bfs, name, cache, rw, compact_flag, page_size);
}
-
static
struct zebra_register *zebra_register_open (ZebraService zs, const char *name,
int rw, int useshadow, Res res,
zebra_close_res(zh);
}
}
+ if (zh->res)
+ {
+ int approx = 0;
+ if (res_get_int(zh->res, "estimatehits", &approx) == ZEBRA_OK)
+ zebra_set_approx_limit(zh, approx);
+ }
}
void map_basenames_func (void *vp, const char *name, const char *value)
ZEBRA_RES zebra_set_approx_limit(ZebraHandle zh, zint approx_limit)
{
if (approx_limit == 0)
- approx_limit = 2000000000;
+ approx_limit = DEFAULT_APPROX_LIMIT;
zh->approx_limit = approx_limit;
return ZEBRA_OK;
}
}
else
{
- if (ret == ZEBRA_OK) /* only need to set it once */
+ /* only need to set it once */
+ if (pos_array[i] < zh->approx_limit && ret == ZEBRA_OK)
+ {
zebra_setError_zint(zh,
YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE,
pos_array[i]);
- ret = ZEBRA_FAIL;
- break;
+ ret = ZEBRA_FAIL;
+ break;
+ }
+ recs[i].buf = 0; /* no record and no error issued */
+ recs[i].len = 0;
+ recs[i].errCode = 0;
+ recs[i].format = VAL_NONE;
+ recs[i].sysno = 0;
}
}
zebra_meta_records_destroy(zh, poset, num_recs);
-/* $Id: zserver.c,v 1.134 2005-05-24 11:35:42 adam Exp $
+/* $Id: zserver.c,v 1.135 2005-06-13 10:29:20 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
r->last_in_set = 0;
res = zebra_records_retrieve (zh, r->stream, r->setname, r->comp,
- r->request_format, 1, &retrievalRecord);
+ r->request_format, 1, &retrievalRecord);
if (res != ZEBRA_OK)
{
/* non-surrogate diagnostic */