-/* $Id: index.h,v 1.204 2007-10-31 16:56:14 adam Exp $
+/* $Id: index.h,v 1.205 2007-11-01 14:10:03 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
#define FIRST_IN_FIELD_CHAR 1
#define FIRST_IN_FIELD_LEN 2
+ZEBRA_RES zebra_term_limits_APT(ZebraHandle zh,
+ Z_AttributesPlusTerm *zapt,
+ zint *hits_limit_value,
+ const char **term_ref_id_str,
+ NMEM nmem);
+
YAZ_END_CDECL
#endif
-/* $Id: rpnscan.c,v 1.17 2007-10-31 16:56:14 adam Exp $
+/* $Id: rpnscan.c,v 1.18 2007-11-01 14:10:03 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
return ZEBRA_OK;
}
-static void count_set(ZebraHandle zh, RSET rset, zint *count)
+static void count_set(ZebraHandle zh, RSET rset, zint *count, zint approx_limit)
{
zint psysno = 0;
struct it_key key;
yaz_log(YLOG_DEBUG, "count_set");
- rset->hits_limit = zh->approx_limit;
+ rset->hits_limit = approx_limit;
*count = 0;
rfd = rset_open(rset, RSETF_READ);
{
int i;
RSET rset = 0;
+ zint approx_limit = zh->approx_limit;
+ AttrType global_hits_limit_attr;
+ int l;
+ attr_init_APT(&global_hits_limit_attr, zapt, 12);
+
+ l = attr_find(&global_hits_limit_attr, NULL);
+ if (l != -1)
+ approx_limit = l;
+
for (i = 0; i < ord_no; i++)
{
if (ar[i].isam_p && strcmp(wrbuf_cstr(ar[i].term), term) == 0)
wrbuf_buf(ar[i].term), wrbuf_len(ar[i].term),
NULL, 1, zapt->term->which, nmem,
kc, kc->scope, ol, index_type,
- 0 /* hits_limit */,
+ 0 /* hits_limit_value */,
0 /* term_ref_id_str */);
if (!rset)
rset = rset_t;
rset = rset_create_and(nmem, kc, kc->scope, 2, rsets);
}
/* count it */
- count_set(zh, rset, &count);
+ count_set(zh, rset, &count, approx_limit);
if (pos != -1)
{
-/* $Id: rpnsearch.c,v 1.19 2007-10-31 16:56:14 adam Exp $
+/* $Id: rpnsearch.c,v 1.20 2007-11-01 14:10:03 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
const char *xpath_use,
struct ord_list **ol);
-static ZEBRA_RES term_limits_APT(ZebraHandle zh,
- Z_AttributesPlusTerm *zapt,
- zint *hits_limit_value,
- const char **term_ref_id_str,
- NMEM nmem)
+ZEBRA_RES zebra_term_limits_APT(ZebraHandle zh,
+ Z_AttributesPlusTerm *zapt,
+ zint *hits_limit_value,
+ const char **term_ref_id_str,
+ NMEM nmem)
{
AttrType term_ref_id_attr;
AttrType hits_limit_attr;
WRBUF term_dict = wrbuf_alloc();
*rset = 0;
- term_limits_APT(zh, zapt, &hits_limit_value, &term_ref_id_str, stream);
+ zebra_term_limits_APT(zh, zapt, &hits_limit_value, &term_ref_id_str,
+ stream);
grep_info->isam_p_indx = 0;
res = string_term(zh, zapt, term_sub, term_dict,
attributeSet, stream, grep_info,
zint hits_limit_value;
const char *term_ref_id_str = 0;
- term_limits_APT(zh, zapt, &hits_limit_value, &term_ref_id_str, stream);
+ zebra_term_limits_APT(zh, zapt, &hits_limit_value, &term_ref_id_str,
+ stream);
yaz_log(log_level_rpn, "APT_numeric t='%s'", termz);
if (grep_info_prepare(zh, zapt, &grep_info, index_type) == ZEBRA_FAIL)