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