jpountz commented on a change in pull request #1351: LUCENE-9280: Collectors to
skip noncompetitive documents
URL: https://github.com/apache/lucene-solr/pull/1351#discussion_r410690894
##########
File path: lucene/core/src/java/org/apache/lucene/search/ScoreMode.java
##########
@@ -24,37 +24,53 @@
/**
* Produced scorers will allow visiting all matches and get their score.
*/
- COMPLETE {
- @Override
- public boolean needsScores() {
- return true;
- }
- },
+ COMPLETE(true, true),
/**
* Produced scorers will allow visiting all matches but scores won't be
* available.
*/
- COMPLETE_NO_SCORES {
- @Override
- public boolean needsScores() {
- return false;
- }
- },
+ COMPLETE_NO_SCORES(true, false),
/**
* Produced scorers will optionally allow skipping over non-competitive
* hits using the {@link Scorer#setMinCompetitiveScore(float)} API.
*/
- TOP_SCORES {
- @Override
- public boolean needsScores() {
- return true;
- }
- };
+ TOP_SCORES(false, true),
+
+ /**
+ * ScoreMode for top field collectors that can provide their own iterators,
+ * to optionally allow to skip for non-competitive docs
+ */
+ TOP_DOCS(false, false),
+
+ /**
+ * ScoreMode for top field collectors that can provide their own iterators,
+ * to optionally allow to skip for non-competitive docs.
+ * This mode is used when there is a secondary sort by _score.
+ */
+ TOP_DOCS_WITH_SCORES(false, true);
Review comment:
We need both because the first one sorts by score first and should use e.g.
block-max WAND while the latter sorts by field so block-max WAND isn't
relevant, but we still need to disable bulk scoring. `needsScores` and
`isExhaustive` are not complete descriptions of these enum constants.
----------------------------------------------------------------
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]