zacharymorn commented on a change in pull request #240:
URL: https://github.com/apache/lucene/pull/240#discussion_r710741804



##########
File path: 
lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
##########
@@ -179,8 +178,7 @@ protected int countDocsWithClass() throws IOException {
       if (query != null) {
         q.add(query, BooleanClause.Occur.MUST);
       }
-      indexSearcher.search(q.build(), classQueryCountCollector);
-      docCount = classQueryCountCollector.getTotalHits();
+      docCount = indexSearcher.search(q.build(), new 
TotalHitCountCollectorManager());

Review comment:
       Done. Also updated the implementation of `IndexSearcher#count` to use 
`TotalHitCountCollectorManager`. 

##########
File path: 
lucene/classification/src/java/org/apache/lucene/classification/CachingNaiveBayesClassifier.java
##########
@@ -179,10 +179,8 @@ public CachingNaiveBayesClassifier(
         if (query != null) {
           booleanQuery.add(query, BooleanClause.Occur.MUST);
         }
-        TotalHitCountCollector totalHitCountCollector = new 
TotalHitCountCollector();
-        indexSearcher.search(booleanQuery.build(), totalHitCountCollector);
 
-        int ret = totalHitCountCollector.getTotalHits();
+        int ret = indexSearcher.search(booleanQuery.build(), new 
TotalHitCountCollectorManager());

Review comment:
       Done.




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