Re: Fastest way to get number of matching documents

2010-07-26 Thread Philippe
Hi Paul, thanks for the code. It is much faster than the implementation before. Cheers, Philippe Am 26.07.2010 16:25, schrieb Paul Libbrecht: Le 26-juil.-10 à 16:01, Michael McCandless a écrit : You can make a custom Collector? Ie, it'd just increment a counter for each hit. As long a

Re: Fastest way to get number of matching documents

2010-07-26 Thread Paul Libbrecht
Le 26-juil.-10 à 16:01, Michael McCandless a écrit : 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. I've done that. Code below. It feels a bit stupid to have to do that thoug

Re: Fastest way to get number of matching documents

2010-07-26 Thread Michael McCandless
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 wrote: > Hi, > > for some queries I'm only interested in the number of matching documen

Fastest way to get number of matching documents

2010-07-26 Thread Philippe
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]