X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fextract.c;h=fa7f652a97fd3abe3b37453b902c704840ca4286;hb=83533000f9456dcab2fc171abafd84d6104d4087;hp=1e6a3953b4df32d6c9220216d84fa653aca3433a;hpb=f3425fb457792aae865096cf9acf5cb41798b1d1;p=idzebra-moved-to-github.git diff --git a/index/extract.c b/index/extract.c index 1e6a395..fa7f652 100644 --- a/index/extract.c +++ b/index/extract.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: extract.c,v $ - * Revision 1.97 1999-07-06 12:28:04 adam + * Revision 1.99 2000-02-24 10:57:02 adam + * Sequence number incremented after each incomplete-field. + * + * Revision 1.98 1999/09/07 07:19:21 adam + * Work on character mapping. Implemented replace rules. + * + * Revision 1.97 1999/07/06 12:28:04 adam * Updated record index structure. Format includes version ID. Compression * algorithm ID is stored for each record block. * @@ -649,6 +655,7 @@ static void wordInit (struct recExtractCtrl *p, RecWord *w) w->attrSet = VAL_BIB1; w->attrUse = 1016; w->reg_type = 'w'; + w->extractCtrl = p; } static struct sortKey { @@ -806,6 +813,7 @@ static void addIncompleteField (RecWord *p) return; addString (p, buf, i); } + (p->seqnos[p->reg_type])++; /* to separate this from next one */ } static void addCompleteField (RecWord *p) @@ -856,6 +864,13 @@ static void addCompleteField (RecWord *p) static void addRecordKey (RecWord *p) { + WRBUF wrbuf; + if ((wrbuf = zebra_replace(p->zebra_maps, p->reg_type, 0, + p->string, p->length))) + { + p->string = wrbuf_buf(wrbuf); + p->length = wrbuf_len(wrbuf); + } if (zebra_maps_is_complete (p->zebra_maps, p->reg_type)) addCompleteField (p); else @@ -1291,8 +1306,8 @@ static int recordExtract (SYSNO *sysno, const char *fname, extractCtrl.fh = fi; extractCtrl.subType = subType; extractCtrl.init = wordInit; - extractCtrl.addWord = addRecordKey; - extractCtrl.addSchema = addSchema; + extractCtrl.tokenAdd = addRecordKey; + extractCtrl.schemaAdd = addSchema; extractCtrl.dh = rGroup->dh; for (i = 0; i<256; i++) { @@ -1632,7 +1647,7 @@ int fileExtract (SYSNO *sysno, const char *fname, { if (zebraExplain_newDatabase (zti, rGroup->databaseName, rGroup->explainDatabase)) - abort (); + return 0; } if (rGroup->flagStoreData == -1) @@ -1760,8 +1775,8 @@ static int explain_extract (void *handle, Record rec, data1_node *n) reckeys.prevSeqNo = 0; extractCtrl.init = wordInit; - extractCtrl.addWord = addRecordKey; - extractCtrl.addSchema = addSchema; + extractCtrl.tokenAdd = addRecordKey; + extractCtrl.schemaAdd = addSchema; extractCtrl.dh = rGroup->dh; for (i = 0; i<256; i++) extractCtrl.seqno[i] = 0;