-/* $Id: zrpn.c,v 1.129 2003-02-27 11:29:13 adam Exp $
+/* $Id: zrpn.c,v 1.131 2003-03-06 11:58:08 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
parms.temp_path = res_get (zh->res, "setTmpDir");
result = rset_create (rset_kind_temp, &parms);
rsfd_result = rset_open (result, RSETF_WRITE);
-
+
while (*more)
{
for (i = 1; i<rset_no; i++)
rset_temp_parms parms;
RSFD rsfd_result;
- logf (LOG_LOG, "generic prox, dist = %d, relation = %d, ordered =%d, exclusion=%d",
- distance, relation, ordered, exclusion);
+ yaz_log (LOG_LOG, "generic prox, dist=%d, relation=%d, ordered=%d"
+ ", exclusion=%d",
+ distance, relation, ordered, exclusion);
parms.rset_term = rset_term_create (prox_term, length_prox_term,
flags, term_type);
parms.rset_term->nn = min_nn;
static int parse_xpath(ZebraHandle zh, Z_AttributesPlusTerm *zapt,
oid_value attributeSet,
- struct xpath_location_step *xpath, NMEM mem)
+ struct xpath_location_step *xpath, int max, NMEM mem)
{
oid_value curAttributeSet = attributeSet;
AttrType use;
const char *use_string = 0;
- int no = 0;
attr_init (&use, zapt, 1);
attr_find_ex (&use, &curAttributeSet, &use_string);
if (!use_string || *use_string != '/')
return -1;
- return (parse_xpath_str(use_string, xpath, mem));
+ return zebra_parse_xpath_str(use_string, xpath, max, mem);
}
if (sort_flag)
return rpn_sort_spec (zh, zapt, attributeSet, stream, sort_sequence,
rank_type);
- xpath_len = parse_xpath(zh, zapt, attributeSet, xpath, stream);
+ xpath_len = parse_xpath(zh, zapt, attributeSet, xpath, 10, stream);
if (xpath_len >= 0)
{
xpath_use = 1016;
oid_value attributeset,
int num_bases, char **basenames,
int *position, int *num_entries, ZebraScanEntry **list,
- int *is_partial)
+ int *is_partial, RSET limit_set, int return_zero)
{
int i;
int pos = *position;
char rank_type[128];
int complete_flag;
int sort_flag;
+
*list = 0;
if (attributeset == VAL_NONE)
attributeset = VAL_BIB1;
+ if (!limit_set)
+ {
+ AttrType termset;
+ int termset_value_numeric;
+ const char *termset_value_string;
+ attr_init (&termset, zapt, 8);
+ termset_value_numeric =
+ attr_find_ex (&termset, NULL, &termset_value_string);
+ if (termset_value_numeric != -1)
+ {
+ char resname[32];
+ const char *termset_name = 0;
+
+ if (termset_value_numeric != -2)
+ {
+
+ sprintf (resname, "%d", termset_value_numeric);
+ termset_name = resname;
+ }
+ else
+ termset_name = termset_value_string;
+
+ limit_set = resultSetRef (zh, termset_name);
+ }
+ }
+
yaz_log (LOG_DEBUG, "position = %d, num = %d set=%d",
pos, num, attributeset);
ptr[j]++;
}
}
+ if (limit_set)
+ {
+ rset_bool_parms bool_parms;
+
+ bool_parms.key_size = sizeof(struct it_key);
+ bool_parms.cmp = key_compare_it;
+ bool_parms.rset_l = rset;
+ bool_parms.rset_r = rset_dup(limit_set);
+
+ rset = rset_create (rset_kind_and, &bool_parms);
+ }
count_set (rset, &glist[i+before].occurrences);
rset_delete (rset);
}
ptr[j]++;
}
}
+ if (limit_set)
+ {
+ rset_bool_parms bool_parms;
+
+ bool_parms.key_size = sizeof(struct it_key);
+ bool_parms.cmp = key_compare_it;
+ bool_parms.rset_l = rset;
+ bool_parms.rset_r = rset_dup(limit_set);
+
+ rset = rset_create (rset_kind_and, &bool_parms);
+ }
count_set (rset, &glist[before-1-i].occurrences);
rset_delete (rset);
}