LUCENE-6329: Calling score() should be ok even if needsScores is false.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1663756 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2015-03-03 17:58:22 +00:00
parent 0689a2e0e0
commit 3d6de9371d
1 changed files with 9 additions and 6 deletions

View File

@ -152,13 +152,16 @@ abstract class DisjunctionScorer extends Scorer {
previous = w;
}
}
} else {
// since we don't need scores, let's pretend we have a single match
topScorers.next = null;
}
// We need to explicitely set the list of top scorers to avoid the
// laziness of DisjunctionScorer.score() that would take all scorers
// positioned on the same doc as the top of the pq, including
// non-matching scorers
DisjunctionScorer.this.topScorers = topScorers;
}
return true;
}
};