-/* $Id: index.h,v 1.139 2005-05-31 13:01:37 adam Exp $
+/* $Id: index.h,v 1.140 2005-06-06 21:31:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
int *position, int *num_entries, ZebraScanEntry **list,
int *is_partial, RSET limit_set, int return_zero);
-RSET rset_trunc (ZebraHandle zh, ISAM_P *isam_p, int no,
- const char *term, int length_term, const char *flags,
- int preserve_position, int term_type, NMEM rset_nmem,
- struct rset_key_control *kctrl, int scope);
+RSET rset_trunc(ZebraHandle zh, ISAM_P *isam_p, int no,
+ const char *term, int length_term, const char *flags,
+ int preserve_position, int term_type, NMEM rset_nmem,
+ struct rset_key_control *kctrl, int scope,
+ struct ord_list *ol);
void resultSetAddTerm (ZebraHandle zh, ZebraSet s, int reg_type,
const char *db, int set,
-/* $Id: trunc.c,v 1.58 2005-05-24 11:35:42 adam Exp $
+/* $Id: trunc.c,v 1.59 2005-06-06 21:31:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
RSET rset_trunc(ZebraHandle zi, ISAM_P *isam_p, int no,
const char *term, int length, const char *flags,
int preserve_position, int term_type, NMEM rset_nmem,
- struct rset_key_control *kctrl, int scope)
+ struct rset_key_control *kctrl, int scope,
+ struct ord_list *ol)
{
TERMID termid;
RSET result;
int trunc_chunk;
- termid = rset_term_create(term, length, flags, term_type, rset_nmem);
+ termid = rset_term_create(term, length, flags, term_type, rset_nmem, ol);
if (no < 1)
return rsnull_create(rset_nmem, kctrl, termid);
-/* $Id: zrpn.c,v 1.194 2005-06-02 11:59:54 adam Exp $
+/* $Id: zrpn.c,v 1.195 2005-06-06 21:31:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
Z_AttributesPlusTerm *zapt;
} AttrType;
+static struct ord_list *ord_list_create(NMEM nmem)
+{
+ return 0;
+}
+
+static struct ord_list *ord_list_append(NMEM nmem, struct ord_list *list,
+ int ord)
+{
+ struct ord_list *n = nmem_malloc(nmem, sizeof(*n));
+ n->ord = ord;
+ n->next = list;
+ return n;
+}
static int log_level_set = 0;
static int log_level_rpn = 0;
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,
+ struct ord_list **ol);
static ZEBRA_RES term_trunc(ZebraHandle zh,
Z_AttributesPlusTerm *zapt,
struct rset_key_control *kc)
{
ZEBRA_RES res;
+ struct ord_list *ol;
*rset = 0;
grep_info->isam_p_indx = 0;
res = string_term(zh, zapt, term_sub, attributeSet, stream, grep_info,
reg_type, complete_flag, num_bases, basenames,
- term_dst, xpath_use);
+ term_dst, xpath_use, &ol);
if (res != ZEBRA_OK)
return res;
if (!*term_sub) /* no more terms ? */
grep_info->isam_p_indx, term_dst,
strlen(term_dst), rank_type, 1 /* preserve pos */,
zapt->term->which, rset_nmem,
- kc, kc->scope);
+ kc, kc->scope, ol);
if (!*rset)
return ZEBRA_FAIL;
return ZEBRA_OK;
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,
+ struct ord_list **ol)
{
char term_dict[2*IT_MAX_WORD+4000];
int j, r, base_no;
int errCode = 0; /* err code (if any is not OK) */
char *errString = 0; /* addinfo */
+
+ *ol = ord_list_create(stream);
+
rpn_char_map_prepare (zh->reg, reg_type, &rcmi);
attr_init(&use, zapt, 1);
use_value = attr_find_ex(&use, &curAttributeSet, &use_string);
term_dict[prefix_len++] = ord_buf[i];
}
attp.local_attributes = 0; /* no more attributes */
+ *ol = ord_list_append(stream, *ol, ord);
}
else
{
local_attr->local);
if (ord < 0)
continue;
+ *ol = ord_list_append(stream, *ol, ord);
if (prefix_len)
term_dict[prefix_len++] = '|';
else
strlen(term_dst), rank_type,
0 /* preserve position */,
zapt->term->which, rset_nmem,
- kc, kc->scope);
+ kc, kc->scope, 0);
if (!result_sets[num_result_sets])
break;
num_result_sets++;
rset = rset_trunc(zh, grep_info.isam_p_buf,
grep_info.isam_p_indx, term, strlen(term),
flags, 1, term_type,rset_nmem,
- kc, kc->scope);
+ kc, kc->scope, 0);
grep_info_delete(&grep_info);
return rset;
}
rset = rset_trunc(zh, &scan_info_array[j0].list[ptr[j0]].isam_p, 1,
glist[lo].term, strlen(glist[lo].term),
NULL, 0, zapt->term->which, rset_nmem,
- kc, kc->scope);
+ kc, kc->scope, 0);
}
ptr[j0]++; /* move index for this set .. */
/* get result set for remaining scan terms */
glist[lo].term,
strlen(glist[lo].term), NULL, 0,
zapt->term->which,rset_nmem,
- kc, kc->scope);
+ kc, kc->scope, 0);
rset = rsmulti_or_create(rset_nmem, kc,
kc->scope, 0 /* termid */,
2, rsets);
(zh, &scan_info_array[j0].list[before-1-ptr[j0]].isam_p, 1,
glist[lo].term, strlen(glist[lo].term),
NULL, 0, zapt->term->which, rset_nmem,
- kc, kc->scope);
+ kc, kc->scope, 0);
ptr[j0]++;
glist[lo].term,
strlen(glist[lo].term), NULL, 0,
zapt->term->which, rset_nmem,
- kc, kc->scope);
+ kc, kc->scope, 0);
rset = rsmulti_or_create(rset_nmem, kc,
kc->scope, 0 /* termid */, 2, rsets);