From ddd6e6bffac75d2671330b14b262a6594212dcce Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Tue, 2 May 2006 08:27:43 +0000 Subject: [PATCH] added possibility to display static rank information in output of xslt and alvis filter. Added member staticrank to recRetrieveCtrl. --- include/idzebra/recctrl.h | 3 ++- index/retrieve.c | 3 ++- recctrl/alvis.c | 8 +++++--- recctrl/xslt.c | 8 +++++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/idzebra/recctrl.h b/include/idzebra/recctrl.h index 3e1d66f..88a91db 100644 --- a/include/idzebra/recctrl.h +++ b/include/idzebra/recctrl.h @@ -1,4 +1,4 @@ -/* $Id: recctrl.h,v 1.15 2006-04-26 11:12:31 adam Exp $ +/* $Id: recctrl.h,v 1.16 2006-05-02 08:27:43 marc Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -96,6 +96,7 @@ struct recRetrieveCtrl { char *encoding; /* preferred character encoding */ zint localno; /* local id of record */ int score; /* score 0-1000 or -1 if none */ + int staticrank; /* static rank >= 0, 0 if none */ int recordSize; /* size of record in bytes */ char *fname; /* name of file (or NULL if internal) */ data1_handle dh; diff --git a/index/retrieve.c b/index/retrieve.c index c342d7d..675f7e0 100644 --- a/index/retrieve.c +++ b/index/retrieve.c @@ -1,4 +1,4 @@ -/* $Id: retrieve.c,v 1.38 2006-04-25 13:52:38 adam Exp $ +/* $Id: retrieve.c,v 1.39 2006-05-02 08:27:43 marc Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -253,6 +253,7 @@ int zebra_record_fetch (ZebraHandle zh, SYSNO sysno, int score, } } retrieveCtrl.localno = sysno; + retrieveCtrl.staticrank = recordAttr->staticrank; retrieveCtrl.score = score; retrieveCtrl.recordSize = recordAttr->recordSize; retrieveCtrl.odr = stream; diff --git a/recctrl/alvis.c b/recctrl/alvis.c index b898277..fd35eae 100644 --- a/recctrl/alvis.c +++ b/recctrl/alvis.c @@ -1,4 +1,4 @@ -/* $Id: alvis.c,v 1.9 2006-04-26 11:12:31 adam Exp $ +/* $Id: alvis.c,v 1.10 2006-05-02 08:27:43 marc Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -582,13 +582,15 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) window_size = atoi(schema->include_snippet); params[0] = 0; - set_param_str(params, "schema", esn, p->odr); + set_param_int(params, "id", p->localno, p->odr); if (p->fname) set_param_str(params, "filename", p->fname, p->odr); + if (p->staticrank >= 0) + set_param_int(params, "rank", p->staticrank, p->odr); + set_param_str(params, "schema", esn, p->odr); if (p->score >= 0) set_param_int(params, "score", p->score, p->odr); set_param_int(params, "size", p->recordSize, p->odr); - set_param_int(params, "id", p->localno, p->odr); if (window_size >= 0) set_param_xml(params, "snippet", snippet_doc(p, 1, window_size), diff --git a/recctrl/xslt.c b/recctrl/xslt.c index 2b88110..cb9b8a9 100644 --- a/recctrl/xslt.c +++ b/recctrl/xslt.c @@ -1,4 +1,4 @@ -/* $Id: xslt.c,v 1.19 2006-04-26 13:27:16 marc Exp $ +/* $Id: xslt.c,v 1.20 2006-05-02 08:27:43 marc Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -628,13 +628,15 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p) window_size = atoi(schema->include_snippet); params[0] = 0; - set_param_str(params, "schema", esn, p->odr); + set_param_int(params, "id", p->localno, p->odr); if (p->fname) set_param_str(params, "filename", p->fname, p->odr); + if (p->staticrank >= 0) + set_param_int(params, "rank", p->staticrank, p->odr); + set_param_str(params, "schema", esn, p->odr); if (p->score >= 0) set_param_int(params, "score", p->score, p->odr); set_param_int(params, "size", p->recordSize, p->odr); - set_param_int(params, "id", p->localno, p->odr); if (window_size >= 0) set_param_xml(params, "snippet", snippet_doc(p, 1, window_size), -- 1.7.10.4