/*
- * Copyright (C) 1994-1997, Index Data I/S
+ * Copyright (C) 1994-1998, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zrpn.c,v $
- * Revision 1.69 1997-10-29 12:05:02 adam
+ * Revision 1.72 1998-01-07 13:53:41 adam
+ * Queries using simple ranked operands returns right number of hits.
+ *
+ * Revision 1.71 1997/12/18 10:54:24 adam
+ * New method result set method rs_hits that returns the number of
+ * hits in result-set (if known). The ranked result set returns real
+ * number of hits but only when not combined with other operands.
+ *
+ * Revision 1.70 1997/10/31 12:34:43 adam
+ * Changed a few log statements.
+ *
+ * Revision 1.69 1997/10/29 12:05:02 adam
* Server produces diagnostic "Unsupported Attribute Set" when appropriate.
*
* Revision 1.68 1997/10/27 14:33:06 adam
ISAM_P *new_isam_p_buf;
#ifdef TERM_COUNT
int *new_term_no;
-#endif
-
+#endif
p->isam_p_size = 2*p->isam_p_size + 100;
new_isam_p_buf = xmalloc (sizeof(*new_isam_p_buf) *
p->isam_p_size);
term_dict[prefix_len++] = ')';
term_dict[prefix_len++] = 1;
term_dict[prefix_len++] = reg_type;
- logf (LOG_LOG, "reg_type = %d", term_dict[prefix_len-1]);
+ logf (LOG_DEBUG, "reg_type = %d", term_dict[prefix_len-1]);
term_dict[prefix_len] = '\0';
if (!relational_term (zi, zapt, &termp, term_dict,
attributeSet, grep_info, &max_pos, reg_type))
int r;
parms.key_size = sizeof(struct it_key);
- parms.max_rec = 1000;
+ parms.max_rec = 200;
parms.cmp = key_compare_it;
parms.get_pos = key_get_pos;
parms.is = zi->isam;
parms.isc = zi->isamc;
parms.no_terms = 0;
+ parms.method = RSREL_METHOD_A;
if (zapt->term->which != Z_Term_general)
{
while (1)
{
- logf (LOG_LOG, "APT_phrase termp=%s", termp);
+ logf (LOG_DEBUG, "APT_phrase termp=%s", termp);
grep_info.isam_p_indx = 0;
r = field_term (zi, zapt, &termp, attributeSet, &grep_info,
reg_type, complete_flag, num_bases, basenames);
RSFD rfd;
logf (LOG_DEBUG, "count_set");
+
*count = 0;
rfd = rset_open (r, RSETF_READ|RSETF_SORT_SYSNO);
while (rset_read (r, rfd, &key))
Z_RPNQuery *rpn, int num_bases, char **basenames,
const char *setname, int *hits)
{
+ int i;
RSET rset;
oident *attrset;
oid_value attributeSet;
if (!rset)
return zi->errCode;
if (rset_is_volatile(rset))
- count_set_save(zi, &rset,hits);
+ count_set_save(zi, &rset, hits);
+ else if ((i = rset_hits (rset)) >= 0)
+ *hits = i;
else
count_set (rset, hits);
resultSetAdd (zi, setname, 1, rset);