mirror of
https://github.com/apache/lucene.git
synced 2025-03-04 15:29:28 +00:00
small optimization: don't add docBase unless score may be competitive
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1149256 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8ea59829e4
commit
7fb6c2ecfe
@ -82,8 +82,13 @@ public abstract class TopScoreDocCollector extends TopDocsCollector<ScoreDoc> {
|
||||
assert !Float.isNaN(score);
|
||||
|
||||
totalHits++;
|
||||
if (score < pqTop.score) {
|
||||
// Doesn't compete w/ bottom entry in queue
|
||||
return;
|
||||
}
|
||||
doc += docBase;
|
||||
if (score < pqTop.score || (score == pqTop.score && doc > pqTop.doc)) {
|
||||
if (score == pqTop.score && doc > pqTop.doc) {
|
||||
// Break tie in score by doc ID:
|
||||
return;
|
||||
}
|
||||
pqTop.doc = doc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user