added possibility to display static rank information in output of xslt and alvis...
authorMarc Cromme <marc@indexdata.dk>
Tue, 2 May 2006 08:27:43 +0000 (08:27 +0000)
committerMarc Cromme <marc@indexdata.dk>
Tue, 2 May 2006 08:27:43 +0000 (08:27 +0000)
include/idzebra/recctrl.h
index/retrieve.c
recctrl/alvis.c
recctrl/xslt.c

index 3e1d66f..88a91db 100644 (file)
@@ -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;
index c342d7d..675f7e0 100644 (file)
@@ -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;
index b898277..fd35eae 100644 (file)
@@ -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),
index 2b88110..cb9b8a9 100644 (file)
@@ -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),