X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fextract.c;h=8189504a7d32c91eedf2e925b8a82006651b76f9;hp=3874dfe317fd3a1aab73366883d9b3f1640c2036;hb=c33ea56e3771c3b80ba66ef8fda3a09cad171ebb;hpb=852d5f1f9aa0a70f7e54a68143ee86752394a2f2 diff --git a/index/extract.c b/index/extract.c index 3874dfe..8189504 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.228 2006-08-22 13:39:27 adam Exp $ +/* $Id: extract.c,v 1.229 2006-09-08 14:40:52 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -44,7 +44,7 @@ struct encode_info { }; static int log_level = 0; -static int log_level_initialized = 1; +static int log_level_initialized = 0; static void zebra_init_log_level() { @@ -1329,7 +1329,7 @@ static void extract_add_string(RecWord *p, const char *string, int length) } } -static void extract_add_incomplete_field (RecWord *p) +static void extract_add_incomplete_field(RecWord *p) { ZebraHandle zh = p->extractCtrl->handle; const char *b = p->term_buf; @@ -1339,6 +1339,15 @@ static void extract_add_incomplete_field (RecWord *p) 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]; @@ -1440,11 +1449,14 @@ static void extract_token_add(RecWord *p) { ZebraHandle zh = p->extractCtrl->handle; WRBUF wrbuf; + if (log_level) + { yaz_log(log_level, "extract_token_add " "type=%c index=%s seqno=" ZINT_FORMAT " s=%.*s", p->index_type, p->index_name, p->seqno, p->term_len, p->term_buf); + } if ((wrbuf = zebra_replace(zh->reg->zebra_maps, p->index_type, 0, p->term_buf, p->term_len))) {