X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fextract.c;h=903b7c5f2f4b1cf3eedaf8fcdbd001c8b93650ad;hb=7253cbefce93c35a083505e14d97b3ae24c0a66b;hp=b14053109e6194c38d55eeea3d6988cd15fc36a4;hpb=418038362451c405454fd4bf8dd2100975a8b764;p=idzebra-moved-to-github.git diff --git a/index/extract.c b/index/extract.c index b140531..903b7c5 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.242 2006-11-25 09:15:19 adam Exp $ +/* $Id: extract.c,v 1.244 2006-12-05 08:14:47 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -651,6 +651,11 @@ ZEBRA_RES zebra_extract_record_stream(ZebraHandle zh, *sysno = rec->sysno; recordAttr = rec_init_attr (zh->reg->zei, rec); + if (extractCtrl.staticrank < 0) + { + yaz_log(YLOG_WARN, "Negative staticrank for record. Set to 0"); + extractCtrl.staticrank = 0; + } recordAttr->staticrank = extractCtrl.staticrank; if (matchStr) @@ -1185,20 +1190,12 @@ static void extract_add_incomplete_field(RecWord *p) ZebraHandle zh = p->extractCtrl->handle; const char *b = p->term_buf; int remain = p->term_len; + int first = 1; const char **map = 0; if (remain > 0) map = zebra_maps_input(zh->reg->zebra_maps, p->index_type, &b, remain, 0); - if (map) - { - if (zebra_maps_is_first_in_field(zh->reg->zebra_maps, p->index_type)) - { - /* first in field marker */ - extract_add_string(p, FIRST_IN_FIELD_STR, FIRST_IN_FIELD_LEN); - p->seqno++; - } - } while (map) { char buf[IT_MAX_WORD+1]; @@ -1231,6 +1228,17 @@ static void extract_add_incomplete_field(RecWord *p) } if (!i) return; + + if (first) + { + first = 0; + if (zebra_maps_is_first_in_field(zh->reg->zebra_maps, p->index_type)) + { + /* first in field marker */ + extract_add_string(p, FIRST_IN_FIELD_STR, FIRST_IN_FIELD_LEN); + p->seqno++; + } + } extract_add_string (p, buf, i); p->seqno++; }