Fixed bug #252: Sort does not work.
[idzebra-moved-to-github.git] / index / zvrank.c
index 4c1c4b7..8c1a034 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zvrank.c,v 1.7 2004-06-13 18:44:57 adam Exp $
+/* $Id: zvrank.c,v 1.7.2.1 2004-11-04 12:49:36 heikki Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
    Index Data Aps
 
@@ -779,6 +779,10 @@ static int zv_calc (void *rsi, int sysno)
     yaz_log (LOG_LOG, "sysno=%d score=%d", sysno, score);
     if (score > 1000) /* should not happen */
         score = 1000;
+    /* reset counts for the next record */
+    for (i = 0; i < rs->veclen; i++)
+        rs->rdoc->terms[i].locc=0;
+
     return score;
 }