-/* $Id: zrpn.c,v 1.128 2003-02-26 21:46:37 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
+/* $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
This file is part of the Zebra server.
{
/* set was found, but value wasn't defined */
char val_str[32];
- sprintf (val_str, "%d (1)", use_value);
+ sprintf (val_str, "%d", use_value);
zh->errCode = 114;
zh->errString = nmem_strdup (stream, val_str);
}
if (!prefix_len)
{
char val_str[32];
- sprintf (val_str, "%d (2)", use_value);
+ sprintf (val_str, "%d", use_value);
zh->errCode = 114;
zh->errString = nmem_strdup (stream, val_str);
return -1;
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;
oid_value attributeSet, struct grep_info *grep_info,
int reg_type, int complete_flag,
int num_bases, char **basenames,
- char *term_dst, int xpath_use)
+ char *term_dst, int xpath_use, NMEM stream)
{
char term_dict[2*IT_MAX_WORD+2];
int r, base_no;
logf (LOG_DEBUG, "att_getentbyatt fail. set=%d use=%d r=%d",
curAttributeSet, use_value, r);
if (r == -1)
+ {
+ char val_str[32];
+ sprintf (val_str, "%d", use_value);
+ zh->errString = nmem_strdup (stream, val_str);
zh->errCode = 114;
+ }
else
zh->errCode = 121;
return -1;
}
if (!prefix_len)
{
+ char val_str[32];
+ sprintf (val_str, "%d", use_value);
zh->errCode = 114;
+ zh->errString = nmem_strdup (stream, val_str);
return -1;
}
term_dict[prefix_len++] = ')';
grep_info.isam_p_indx = 0;
r = numeric_term (zh, zapt, &termp, attributeSet, &grep_info,
reg_type, complete_flag, num_bases, basenames,
- term_dst, xpath_use);
+ term_dst, xpath_use,
+ stream);
if (r < 1)
break;
logf (LOG_DEBUG, "term: %s", term_dst);
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);
logf (LOG_DEBUG, "att_getentbyatt fail. set=%d use=%d",
attributeset, use_value);
if (r == -1)
- zh->errCode = 114;
+ {
+ char val_str[32];
+ sprintf (val_str, "%d", use_value);
+ zh->errCode = 114;
+ zh->errString = odr_strdup (stream, val_str);
+ }
else
zh->errCode = 121;
*num_entries = 0;
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);
}