atris commented on a change in pull request #904: LUCENE-8992: Share minimum
score across segment in concurrent search
URL: https://github.com/apache/lucene-solr/pull/904#discussion_r333565075
##########
File path: lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java
##########
@@ -318,19 +350,41 @@ private TopFieldCollector(FieldValueHitQueue<Entry> pq,
int numHits,
scoreMode = needsScores ? ScoreMode.COMPLETE :
ScoreMode.COMPLETE_NO_SCORES;
canSetMinScore = false;
}
+ this.minScoreAcc = minScoreAcc;
}
@Override
public ScoreMode scoreMode() {
return scoreMode;
}
+ protected void updateGlobalMinCompetitiveScore(Scorable scorer) throws
IOException {
+ assert minScoreAcc != null;
+ if (canSetMinScore
+ && hitsThresholdChecker.isThresholdReached()) {
+ MaxScoreAccumulator.Result maxMinScore = minScoreAcc.get();
+ if (maxMinScore != null && maxMinScore.score > minCompetitiveScore) {
+ scorer.setMinCompetitiveScore(maxMinScore.score);
+ minCompetitiveScore = maxMinScore.score;
+ totalHitsRelation = TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO;
+ }
+ }
+ }
+
protected void updateMinCompetitiveScore(Scorable scorer) throws IOException
{
- if (canSetMinScore && hitsThresholdChecker.isThresholdReached() &&
queueFull) {
+ if (canSetMinScore
+ && hitsThresholdChecker.isThresholdReached()
+ && queueFull) {
Review comment:
+1, agreed. We should not be publishing minimum scores when the PQ is not
full, but there is no reason why we shouldnt use the value if it is present
already.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]