gautamworah96 commented on a change in pull request #242:
URL: https://github.com/apache/lucene/pull/242#discussion_r697759445



##########
File path: lucene/core/src/java/org/apache/lucene/search/TermQuery.java
##########
@@ -179,6 +179,15 @@ public Explanation explain(LeafReaderContext context, int 
doc) throws IOExceptio
       }
       return Explanation.noMatch("no matching term");
     }
+
+    @Override
+    public int count(LeafReaderContext context) throws IOException {
+      if (context.reader().hasDeletions() == false) {
+        return context.reader().docFreq(term);

Review comment:
       Ack. I get it now. This uses the faster `seekExact(BytesRef term, 
TermState state)` method in TermsEnum instead of  `seekExact(BytesRef text)`. 
Will fix




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