Remove isamd. It's not been in use for a long time and isamb is better
[idzebra-moved-to-github.git] / index / zvrank.c
index 622278e..4322dda 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zvrank.c,v 1.6 2004-06-08 13:27:48 marc Exp $
+/* $Id: zvrank.c,v 1.8 2004-08-04 08:35:24 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
    Index Data Aps
 
@@ -660,9 +660,10 @@ static void *zv_create (ZebraHandle zh) {
     struct rank_class_info *ci = (struct rank_class_info *)
         xmalloc (sizeof(*ci));
     yaz_log(LOG_DEBUG, "zv_create");
-    wscheme=res_get(res, "zvrank.weighting-scheme");
-    for (i=0; (i < strlen(wscheme)) && (i < 8); i++) 
+    wscheme=res_get_def(res, "zvrank.weighting-scheme", "");
+    for (i=0; wscheme[i] && i < 8; i++) 
         ci->rscheme[i]=wscheme[i];
+    ci->rscheme[i] = '\0';
     return ci;
 }
 
@@ -756,7 +757,7 @@ static void zv_add (void *rsi, int seqno, int i) {
  *  score should be between 0 and 1000. If score cannot be obtained
  *  -1 should be returned.
  */
-static int zv_calc (void *rsi, int sysno)
+static int zv_calc (void *rsi, zint sysno)
 {
     int i, veclen; 
     int score=0;
@@ -775,7 +776,7 @@ static int zv_calc (void *rsi, int sysno)
         dscore=rs->sim_fct(rs->qdoc, rs->rdoc);
     }
     score = dscore * 1000;
-    yaz_log (LOG_LOG, "sysno=%d score=%d", sysno, score);
+    yaz_log (LOG_LOG, "sysno=" ZINT_FORMAT " score=%d", sysno, score);
     if (score > 1000) /* should not happen */
         score = 1000;
     return score;