* Sebastian Hammer, Adam Dickmeiss
*
* $Log: recctrl.h,v $
- * Revision 1.34 2000-03-20 19:08:36 adam
+ * Revision 1.35 2002-04-13 18:16:42 adam
+ * More XPATH work; common sequence numbers for extract keys
+ *
+ * Revision 1.34 2000/03/20 19:08:36 adam
* Added remote record import using Z39.50 extended services and Segment
* Requests.
*
unsigned reg_type;
char *string;
int length;
- int *seqnos;
+ int seqno;
ZebraMaps zebra_maps;
struct recExtractCtrl *extractCtrl;
} RecWord;
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: extract.c,v 1.115 2002-04-04 20:50:36 adam Exp $
+ * $Id: extract.c,v 1.116 2002-04-13 18:16:43 adam Exp $
*/
#include <stdio.h>
#include <assert.h>
static void extract_init (struct recExtractCtrl *p, RecWord *w)
{
w->zebra_maps = p->zebra_maps;
- w->seqnos = p->seqno;
+ w->seqno = 1;
w->attrSet = VAL_BIB1;
w->attrUse = 1016;
w->reg_type = 'w';
unsigned short attrUse;
int lead = 0;
int diff = 0;
- int *pseqno = &p->seqnos[p->reg_type];
+ int *pseqno = &p->seqno;
ZebraHandle zh = p->extractCtrl->handle;
ZebraExplainInfo zei = zh->reg->zei;
struct recKeys *keys = &zh->reg->keys;
-
+
if (keys->buf_used+1024 > keys->buf_max)
{
char *b;
dst += sizeof(*pseqno);
}
keys->buf_used = dst - keys->buf;
- if (*pseqno)
- (*pseqno)++;
}
static void extract_add_sort_string (RecWord *p, const char *string,
if (!i)
return;
extract_add_string (p, buf, i);
+ p->seqno++;
}
- (p->seqnos[p->reg_type])++; /* to separate this from next one */
}
static void extract_add_complete_field (RecWord *p)
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: zrpn.c,v 1.114 2002-04-12 14:55:22 adam Exp $
+ * $Id: zrpn.c,v 1.115 2002-04-13 18:16:43 adam Exp $
*/
#include <stdio.h>
#include <assert.h>
case Z_AttributeValue_complex:
if (src->minor >= element->value.complex->num_list)
break;
+ if (element->attributeSet && attributeSetP)
+ {
+ oident *attrset;
+
+ attrset = oid_getentbyoid (element->attributeSet);
+ *attributeSetP = attrset->value;
+ }
if (element->value.complex->list[src->minor]->which ==
Z_StringOrNumeric_numeric)
{
++(src->minor);
- if (element->attributeSet && attributeSetP)
- {
- oident *attrset;
-
- attrset = oid_getentbyoid (element->attributeSet);
- *attributeSetP = attrset->value;
- }
return
*element->value.complex->list[src->minor-1]->u.numeric;
}
truncation_value = attr_find (&truncation, NULL);
logf (LOG_DEBUG, "truncation value %d", truncation_value);
- if (use_value == -1)
+ if (use_value == -1) /* no attribute - assumy "any" */
use_value = 1016;
- if (use_value == -2)
+ if (use_value == -2) /* string attribute - assumy "any" */
use_value = 1016;
for (base_no = 0; base_no < num_bases; base_no++)
oid_value curAttributeSet = attributeSet;
char term_dict[2048];
int base_no;
+ int reg_type = '0';
struct grep_info grep_info;
- struct rpn_char_map_info rcmi;
yaz_log (LOG_LOG, "rpn_search_xpath 1");
attr_init (&use, zapt, 1);
return rset;
}
- rpn_char_map_prepare (zh->reg, '0', &rcmi);
-
- if (grep_info_prepare (zh, zapt, &grep_info, '0', stream))
+ dict_grep_cmap (zh->reg->dict, 0, 0);
+ if (grep_info_prepare (zh, zapt, &grep_info, reg_type, stream))
return 0;
yaz_log (LOG_LOG, "rpn_search_xpath 2");
for (base_no = 0; base_no < num_bases; base_no++)
{
+ const char *termp = use_string;
rset_between_parms parms;
RSET rset_start_tag, rset_end_tag;
int ord, ord_len, i, r, max_pos;
}
term_dict[prefix_len++] = ')';
term_dict[prefix_len++] = 1;
- term_dict[prefix_len++] = '0';
+ term_dict[prefix_len++] = reg_type;
+
+ termp = use_string;
strcpy (term_dict+prefix_len, use_string);
+
grep_info.isam_p_indx = 0;
yaz_log (LOG_LOG, "rpn_search_xpath 3 %s", term_dict+prefix_len);
r = dict_lookup_grep (zh->reg->dict, term_dict, 0,
}
term_dict[prefix_len++] = ')';
term_dict[prefix_len++] = 1;
- term_dict[prefix_len++] = '0';
+ term_dict[prefix_len++] = reg_type;
+
+ termp = use_string;
+
strcpy (term_dict+prefix_len, use_string);
+
grep_info.isam_p_indx = 0;
r = dict_lookup_grep (zh->reg->dict, term_dict, 0,
&grep_info, &max_pos, 0, grep_handle);
* All rights reserved.
*
* $Log: recgrs.c,v $
- * Revision 1.45 2002-04-12 14:40:42 adam
+ * Revision 1.46 2002-04-13 18:16:43 adam
+ * More XPATH work; common sequence numbers for extract keys
+ *
+ * Revision 1.45 2002/04/12 14:40:42 adam
* Work on XPATH
*
* Revision 1.44 2002/04/11 20:09:47 adam
}
}
-static int dumpkeys(data1_node *n, struct recExtractCtrl *p, int level)
+static int dumpkeys(data1_node *n, struct recExtractCtrl *p, int level,
+ RecWord *wrd)
{
- RecWord wrd;
- (*p->init)(p, &wrd); /* set defaults */
for (; n; n = n->next)
{
if (p->flagShowRecords) /* display element description to user */
if (n->which == DATA1N_tag)
{
- index_termlist (n, n, p, level, &wrd);
+ index_termlist (n, n, p, level, wrd);
/* index start tag */
if (!n->root->u.root.absyn)
- index_xpath (n, p, level, &wrd, 1);
+ index_xpath (n, p, level, wrd, 1);
}
if (n->child)
- if (dumpkeys(n->child, p, level + 1) < 0)
+ if (dumpkeys(n->child, p, level + 1, wrd) < 0)
return -1;
}
if (par)
- index_termlist (par, n, p, level, &wrd);
+ index_termlist (par, n, p, level, wrd);
if (!n->root->u.root.absyn)
- index_xpath (n, p, level, &wrd, 1016);
+ index_xpath (n, p, level, wrd, 1016);
}
{
/* index end tag */
if (!n->root->u.root.absyn)
- index_xpath (n, p, level, &wrd, 2);
+ index_xpath (n, p, level, wrd, 2);
}
{
oident oe;
int oidtmp[OID_SIZE];
+ RecWord wrd;
oe.proto = PROTO_Z3950;
oe.oclass = CLASS_SCHEMA;
if ((oid_ent_to_oid (&oe, oidtmp)))
(*p->schemaAdd)(p, oidtmp);
}
- return dumpkeys(n, p, 0);
+ (*p->init)(p, &wrd);
+ return dumpkeys(n, p, 0, &wrd);
}
static int grs_extract_sub(struct grs_handlers *h, struct recExtractCtrl *p,
struct grs_read_info gri;
oident oe;
int oidtmp[OID_SIZE];
+ RecWord wrd;
gri.readf = p->readf;
gri.seekf = p->seekf;
#if 0
data1_pr_tree (p->dh, n, stdout);
#endif
- if (dumpkeys(n, p, 0) < 0)
+ (*p->init)(p, &wrd);
+ if (dumpkeys(n, p, 0, &wrd) < 0)
{
data1_free_tree(p->dh, n);
return RECCTRL_EXTRACT_ERROR;
# Zebra indexes as referred to from the *.abs-files.
-# $Id: default.idx,v 1.8 2000-03-02 14:35:19 adam Exp $
+# $Id: default.idx,v 1.9 2002-04-13 18:16:43 adam Exp $
#
# Traditional word index
index w
# Null map index (no mapping at all)
index 0
completeness 0
+position 1
charmap @
# Sort register (no mapping at all)