jpountz commented on code in PR #13066: URL: https://github.com/apache/lucene/pull/13066#discussion_r1491684699
########## lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java: ########## @@ -43,10 +47,20 @@ protected float score(DisiWrapper topList) throws IOException { return (float) score; } + @Override + public int advanceShallow(int target) throws IOException { + for (Scorer scorer : scorers) { + scorer.advanceShallow(target); + } + return super.advanceShallow(target); Review Comment: Should we take the min across all clauses or something like that instead of returning NO_MORE_DOCS? ########## lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java: ########## @@ -43,10 +47,20 @@ protected float score(DisiWrapper topList) throws IOException { return (float) score; } + @Override + public int advanceShallow(int target) throws IOException { + for (Scorer scorer : scorers) { + scorer.advanceShallow(target); + } + return super.advanceShallow(target); + } + @Override public float getMaxScore(int upTo) throws IOException { - // It's ok to return a bad upper bound here since we use WANDScorer when - // we actually care about block scores. - return Float.MAX_VALUE; + double maxScore = 0; + for (Scorer scorer : scorers) { + maxScore += scorer.getMaxScore(DocIdSetIterator.NO_MORE_DOCS); Review Comment: Computing the max score up to `upTo` should be enough, no need to use `NO_MORE_DOCS`? -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org 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