mirror of https://github.com/apache/lucene.git
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 git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150523 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ba6bb29e3b
commit
65ce0a021b
|
@ -95,6 +95,9 @@ extends PriorityQueue {
|
||||||
c = (fields[i].reverse) ? comparators[i].compare (docB, docA)
|
c = (fields[i].reverse) ? comparators[i].compare (docB, docA)
|
||||||
: comparators[i].compare (docA, docB);
|
: 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;
|
return c > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue