You can make a custom Collector? Ie, it'd just increment a counter for each hit.
As long as it does not call the Scorer.score() method then no scoring is done. Mike On Mon, Jul 26, 2010 at 9:18 AM, Philippe <mailer.tho...@gmail.com> wrote: > Hi, > > for some queries I'm only interested in the number of matching documents. Is > there a better/faster way to perform such a query, instead of retrieving all > TopDocs and counting the number of totalHits [1]? > And is it possible/worthwhile to "deactivate" ranking? > > Cheers, > Philippe > > [1] > TopDocs td= is.search(query, is.maxDoc()); > int result= td.totalHits; > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org