From: Adam Dickmeiss Date: Tue, 2 Jul 2002 20:20:09 +0000 (+0000) Subject: idzebra:{filename,score,size,localnumber} tags for XML X-Git-Tag: ZEBRA.1.3.0~40 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=c4e6b0ddb98fc8442bd1ec2b0f4340e99bea18cc;p=idzebra-moved-to-github.git idzebra:{filename,score,size,localnumber} tags for XML --- diff --git a/include/recctrl.h b/include/recctrl.h index 485b746..72db67e 100644 --- a/include/recctrl.h +++ b/include/recctrl.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: recctrl.h,v $ - * Revision 1.35 2002-04-13 18:16:42 adam + * Revision 1.36 2002-07-02 20:20:09 adam + * idzebra:{filename,score,size,localnumber} tags for XML + * + * 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 @@ -184,6 +187,7 @@ struct recRetrieveCtrl { int localno; /* local id of record */ int score; /* score 0-1000 or -1 if none */ int recordSize; /* size of record in bytes */ + char *fname; /* name of file (or NULL if internal) */ char *subType; data1_handle dh; diff --git a/index/retrieve.c b/index/retrieve.c index 650eb82..1ce3f6b 100644 --- a/index/retrieve.c +++ b/index/retrieve.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: retrieve.c,v $ - * Revision 1.17 2002-05-03 13:49:04 adam + * Revision 1.18 2002-07-02 20:20:09 adam + * idzebra:{filename,score,size,localnumber} tags for XML + * + * Revision 1.17 2002/05/03 13:49:04 adam * play with shellsort * * Revision 1.16 2002/04/04 20:50:37 adam @@ -165,6 +168,7 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, logf (LOG_DEBUG, "retrieve localno=%d score=%d", sysno, score); retrieveCtrl.fh = &fc; fc.fd = -1; + retrieveCtrl.fname = fname; if (rec->size[recInfo_storeData] > 0) { retrieveCtrl.readf = zebra_record_int_read; diff --git a/recctrl/recgrs.c b/recctrl/recgrs.c index e11811b..bc0c974 100644 --- a/recctrl/recgrs.c +++ b/recctrl/recgrs.c @@ -2,7 +2,7 @@ * Copyright (C) 1994-2002, Index Data * All rights reserved. * - * $Id: recgrs.c,v 1.51 2002-05-28 21:10:34 adam Exp $ + * $Id: recgrs.c,v 1.52 2002-07-02 20:20:09 adam Exp $ */ #include @@ -513,6 +513,8 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) char *tagname; struct grs_handlers *h = (struct grs_handlers *) clientData; int requested_schema = VAL_NONE; + data1_marctab *marctab; + int dummy; mem = nmem_create(); gri.readf = p->readf; @@ -691,10 +693,20 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) switch (p->output_format = (p->input_format != VAL_NONE ? p->input_format : VAL_SUTRS)) { - data1_marctab *marctab; - int dummy; case VAL_TEXT_XML: + data1_mk_tag_data_int (p->dh, node, "idzebra:size", p->recordSize, + mem); + if (p->score != -1) + data1_mk_tag_data_int (p->dh, node, "idzebra:score", + p->score, mem); + + data1_mk_tag_data_int (p->dh, node, "idzebra:localnumber", p->localno, + mem); + if (p->fname) + data1_mk_tag_data_text(p->dh, node, "idzebra:filename", + p->fname, mem); + if (!(p->rec_buf = data1_nodetoidsgml(p->dh, node, selected, &p->rec_len))) p->diagnostic = 238;