jpountz commented on code in PR #14968:
URL: https://github.com/apache/lucene/pull/14968#discussion_r2219685155


##########
lucene/core/src/java/org/apache/lucene/search/Scorer.java:
##########
@@ -130,4 +130,27 @@ public void nextDocsAndScores(int upTo, Bits liveDocs, 
DocAndFloatFeatureBuffer
     }
     buffer.size = size;
   }
+
+  /**
+   * Apply this {@link Scorer} as a required clause on the given {@link 
DocAndScoreAccBuffer}. This
+   * filters out documents from the buffer that do not match this scorer, and 
adds the scores of
+   * this {@link Scorer} to the scores.
+   */
+  public void applyAsRequiredClause(DocAndScoreAccBuffer buffer) throws 
IOException {
+    DocIdSetIterator iterator = iterator();

Review Comment:
   I wonder if we should throw an exception if this scorer exposes a 
`twoPhaseIterator()` (and add javadocs about it), since running the conjunction 
this way would be less efficient than doing it in a "doc first" fashion.



-- 
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

Reply via email to