/* This file is part of the Zebra server.
- Copyright (C) 1994-2009 Index Data
+ Copyright (C) 1994-2011 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <string.h>
#include <idzebra/util.h>
static int log_level = 0;
static int log_level_initialized = 0;
+
/**
\brief Common constuctor for RFDs
\param rs Result set handle.
void rset_set_hits_limit(RSET rs, zint l)
{
+ yaz_log(log_level, "rset_set_hits_limit %p l=" ZINT_FORMAT, rs, l);
rs->hits_limit = l;
}
TERMID termid;
char buf[100];
- while(rfd->counted_items <= rs->hits_limit
+ while (rfd->counted_items <= rs->hits_limit
&& rset_default_read(rfd, buf, &termid))
;
" hits_limit=" ZINT_FORMAT,
rs, rs->hits_count, rs->hits_limit);
rs->hits_approx = 0;
- if (rs->hits_count > rs->hits_limit)
+ if (rs->hits_count > rs->hits_limit && rs->hits_limit > 0)
{
double cur, tot;
zint est;
rs->hits_approx = 1;
}
}
- yaz_log(log_level, "rset_close p=%p count=" ZINT_FORMAT, rs,
+ yaz_log(log_level, "rset_close(%s) p=%p count=" ZINT_FORMAT,
+ rs->control->desc, rs,
rs->hits_count);
}
rset_close_int(rs, rfd);
rset = (RSET) nmem_malloc(nmem, sizeof(*rset));
yaz_log(log_level, "rs_create(%s) rs=%p (nm=%p)", sel->desc, rset, nmem);
- yaz_log(log_level, " ref_id=%s limit=" ZINT_FORMAT,
- (term && term->ref_id ? term->ref_id : "null"),
- rset->hits_limit);
+ yaz_log(log_level, " ref_id=%s",
+ (term && term->ref_id ? term->ref_id : "null"));
rset->nmem = nmem;
rset->control = sel;
rset->refcount = 1;
while ((more = rset_read(rfd, buf, term)) > 0)
{
- if ((rfd->rset->keycontrol->cmp)(untilbuf, buf) <= 1)
+ if ((rfd->rset->keycontrol->cmp)(untilbuf, buf) < rset->scope)
break;
}
if (log_level)
- yaz_log (log_level, "rset_default_forward exiting m=%d c=%d",
- more, rset->scope);
+ yaz_log(log_level, "rset_default_forward exiting rfd=%p scope=%d m=%d c=%d",
+ rfd, rset->scope, more, rset->scope);
return more;
}