You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/06/16 11:14:49 UTC

[GitHub] [lucene] romseygeek commented on a diff in pull request #964: LUCENE-10620: Pass the Weight to Collectors.

romseygeek commented on code in PR #964:
URL: https://github.com/apache/lucene/pull/964#discussion_r898969670


##########
lucene/core/src/java/org/apache/lucene/search/TotalHitCountCollector.java:
##########
@@ -16,13 +16,17 @@
  */
 package org.apache.lucene.search;
 
+import java.io.IOException;
+import org.apache.lucene.index.LeafReaderContext;
+
 /**
  * Just counts the total number of hits. For cases when this is the only collector used, {@link
  * IndexSearcher#count(Query)} should be called instead of {@link IndexSearcher#search(Query,

Review Comment:
   I don't think this javadoc comment is accurate anymore with these changes?



##########
lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingCollector.java:
##########
@@ -65,4 +68,11 @@ public void collect(int doc) throws IOException {
       }
     };
   }
+
+  @Override
+  public void setWeight(Weight weight) {
+    weightSet = true;

Review Comment:
   Should we assert that the Weight is only set once as well?



-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org