jpountz commented on a change in pull request #242: URL: https://github.com/apache/lucene/pull/242#discussion_r694668737
########## 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: Maybe we should reuse the term state if available so that we can directly seek to the place where this term is stored in the terms dict instead of looking it up a second time? -- 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