Fix bug in retrieval code. If present request was out of sortmax
[idzebra-moved-to-github.git] / index / zsets.c
index 9e95870..4bec43b 100644 (file)
@@ -1,6 +1,6 @@
-/* $Id: zsets.c,v 1.76 2005-01-07 14:44:54 adam Exp $
+/* $Id: zsets.c,v 1.79 2005-04-14 12:01:22 adam Exp $
    Copyright (C) 1995-2005
-   Index Data Aps
+   Index Data ApS
 
 This file is part of the Zebra server.
 
@@ -419,7 +419,7 @@ ZebraMetaRecord *zebra_meta_records_create (ZebraHandle zh, const char *name,
             
             if (sort_info)
                 position = sort_info->num_entries;
-            while (num_i < num && positions[num_i] < position)
+            while (num_i < num && positions[num_i] <= position)
                 num_i++;
            
            if (sset->cache_rfd &&
@@ -825,7 +825,7 @@ void resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset, NMEM nmem)
                 (zebraSet->hits)++;
                 psysno = this_sys;
             }
-            (*rc->add) (handle, seqno, termid);
+            (*rc->add) (handle, CAST_ZINT_TO_INT(seqno), termid);
             
             if ((est==-2) && (zebraSet->hits==esthits))
             { /* time to estimate the hits */