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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to