lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search FieldSortedHitQueue.java
Date Sat, 18 Sep 2004 18:21:18 GMT
dnaber      2004/09/18 11:21:18

  Modified:    src/java/org/apache/lucene/search FieldSortedHitQueue.java
  Log:
  order was undefined in case of duplicate sort keys, this could lead to incorrect results
(documents appearing twice in the result set, other documents missing) if there were more
than 100 matches.
  PR:31241
  
  Revision  Changes    Path
  1.12      +4 -1      jakarta-lucene/src/java/org/apache/lucene/search/FieldSortedHitQueue.java
  
  Index: FieldSortedHitQueue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/FieldSortedHitQueue.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FieldSortedHitQueue.java	21 Jul 2004 19:05:46 -0000	1.11
  +++ FieldSortedHitQueue.java	18 Sep 2004 18:21:17 -0000	1.12
  @@ -95,6 +95,9 @@
         c = (fields[i].reverse) ? comparators[i].compare (docB, docA)
                                 : comparators[i].compare (docA, docB);
       }
  +    // avoid random sort order that could lead to duplicates (bug #31241):
  +    if (c == 0)
  +      return docA.doc > docB.doc;
       return c > 0;
     }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message