-/* $Id: trunc.c,v 1.56 2005-04-20 10:21:29 adam Exp $
+/* $Id: trunc.c,v 1.61 2005-06-22 19:42:38 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
const char *flags, ISAM_P *isam_p, int from, int to,
int merge_chunk, int preserve_position,
int term_type, NMEM rset_nmem,
- const struct key_control *kctrl, int scope,
+ struct rset_key_control *kctrl, int scope,
TERMID termid)
{
RSET result;
RSET rset_trunc(ZebraHandle zi, ISAM_P *isam_p, int no,
const char *term, int length, const char *flags,
int preserve_position, int term_type, NMEM rset_nmem,
- const struct key_control *kctrl, int scope)
+ struct rset_key_control *kctrl, int scope,
+ struct ord_list *ol, int reg_type,
+ zint hits_limit, const char *term_ref_id)
{
TERMID termid;
RSET result;
int trunc_chunk;
+
+ termid = rset_term_create(term, length, flags, term_type, rset_nmem, ol,
+ reg_type, hits_limit, term_ref_id);
if (no < 1)
- return rsnull_create(rset_nmem,kctrl);
- termid = rset_term_create(term, length, flags, term_type,rset_nmem);
+ return rsnull_create(rset_nmem, kctrl, termid);
+
if (zi->reg->isams)
{
if (no == 1)
{
int trunc_limit = atoi(res_get_def(zi->res, "trunclimit", "10000"));
if (no == 1)
- return rsisamb_create(rset_nmem,kctrl, scope,
+ return rsisamb_create(rset_nmem, kctrl, scope,
zi->reg->isamb, *isam_p, termid);
else if (no < trunc_limit)
{
int i;
for (i = 0; i<no; i++)
rsets[i] = rsisamb_create(rset_nmem, kctrl, scope,
- zi->reg->isamb, isam_p[i], termid);
- r = rsmulti_or_create( rset_nmem, kctrl, scope, no, rsets);
+ zi->reg->isamb, isam_p[i],
+ 0 /* termid */);
+ r = rsmulti_or_create(rset_nmem, kctrl, scope,
+ termid /* termid */,
+ no, rsets);
xfree(rsets);
return r;
}
else
{
yaz_log(YLOG_WARN, "Unknown isam set in rset_trunc");
- return rsnull_create(rset_nmem, kctrl);
+ return rsnull_create(rset_nmem, kctrl, 0);
}
trunc_chunk = atoi(res_get_def(zi->res, "truncchunk", "100"));
result = rset_trunc_r(zi, term, length, flags, isam_p, 0, no, trunc_chunk,
- preserve_position, term_type, rset_nmem, kctrl, scope,
- termid);
+ preserve_position, term_type, rset_nmem, kctrl,
+ scope, termid);
return result;
}