X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Frecgrs.c;h=6ebf807be559c0590fe3b4fc389e987aeb3bc675;hb=8e584bbdc77d4c825ed3596c4d8c24a0ab7300e5;hp=7da47f73f918caf54301057f6aa67082dfed257f;hpb=396e9aaedfbed7534e329b42475cd7abe2fd3814;p=idzebra-moved-to-github.git diff --git a/index/recgrs.c b/index/recgrs.c index 7da47f7..6ebf807 100644 --- a/index/recgrs.c +++ b/index/recgrs.c @@ -1,4 +1,4 @@ -/* $Id: recgrs.c,v 1.6 2006-09-28 18:38:47 adam Exp $ +/* $Id: recgrs.c,v 1.9 2006-10-29 17:20:01 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -245,7 +245,7 @@ static int sp_expr(struct source_parser *sp, data1_node *n, RecWord *wrd) return 1; } -static struct source_parser *source_parser_create() +static struct source_parser *source_parser_create(void) { struct source_parser *sp = xmalloc(sizeof(*sp)); @@ -418,11 +418,8 @@ data1_termlist *xpath_termlist_by_tagpath(char *tagpath, data1_node *n) #if OPTIMIZE_MELM /* mark this and following ones with same regexp */ - for (xpe1 = xpe; xpe1; xpe1 = xpe1->next) - { - if (!strcmp(xpe1->regexp, xpe->regexp)) - xpe1->match_state = ok; - } + for (xpe1 = xpe; xpe1; xpe1 = xpe1->match_next) + xpe1->match_state = ok; #endif } assert (ok == 0 || ok == 1); @@ -567,6 +564,7 @@ static void index_xpath(struct source_parser *sp, data1_node *n, if (n->root->u.root.absyn && (tl = xpath_termlist_by_tagpath(tag_path_full, n))) { + zint max_seqno = 0; for (; tl; tl = tl->next) { /* need to copy recword because it may be changed */ @@ -614,7 +612,12 @@ static void index_xpath(struct source_parser *sp, data1_node *n, else (*p->tokenAdd)(&wrd_tl); } + if (wrd_tl.seqno > max_seqno) + max_seqno = wrd_tl.seqno; } + if (max_seqno) + wrd->seqno = max_seqno; + } /* xpath indexing is done, if there was no termlist given, or no ! in the termlist, and default indexing is enabled... */