zacharymorn commented on a change in pull request #2205: URL: https://github.com/apache/lucene-solr/pull/2205#discussion_r559223860
########## File path: lucene/core/src/java/org/apache/lucene/search/WANDScorer.java ########## @@ -149,23 +167,33 @@ private static long scaleMinScore(float minScore, int scalingFactor) { this.doc = -1; this.upTo = -1; // will be computed on the first call to nextDoc/advance + this.needsScore = needsScore; + head = new DisiPriorityQueue(scorers.size()); // there can be at most num_scorers - 1 scorers beyond the current position tail = new DisiWrapper[scorers.size()]; - OptionalInt scalingFactor = OptionalInt.empty(); - for (Scorer scorer : scorers) { - scorer.advanceShallow(0); - float maxScore = scorer.getMaxScore(DocIdSetIterator.NO_MORE_DOCS); - if (maxScore != 0 && Float.isFinite(maxScore)) { - // 0 and +Infty should not impact the scale - scalingFactor = - OptionalInt.of( - Math.min(scalingFactor.orElse(Integer.MAX_VALUE), scalingFactor(maxScore))); + if (needsScore) { Review comment: Updated to check for `scoreMode == TOP_SCORES` instead. ########## File path: lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java ########## @@ -50,7 +50,7 @@ if (tieBreakerMultiplier < 0 || tieBreakerMultiplier > 1) { throw new IllegalArgumentException("tieBreakerMultiplier must be in [0, 1]"); } - if (scoreMode == ScoreMode.TOP_SCORES) { + if (scoreMode.needsScores()) { Review comment: Updated to check for `scoreMode == TOP_SCORES` instead. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org