
ian.lea at gmail
Feb 9, 2010, 10:04 AM
Post #3 of 3
(583 views)
Permalink
|
Write a simple Collector (read the javadocs) that has a collect(int doc) method that does nothing except increment a counter. Use it via one of the search methods that takes a Collector. btw TopDocCollector won't load them all in memory, but obviously it will keep track of the top scoring docs. -- Ian. On Tue, Feb 9, 2010 at 4:44 PM, Klaus Teller <klaus.teller [at] gmx> wrote: > Hi Guys, > > Is there a way to speed up couting documents that satisfy a search query other than by using TopDocCollector.getTotalHits()? > > For instance, if there are 1000000 documents satisfying my search query, how can I count them without loading them all in memory? > > Thanks, > Klaus. > -- > Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - > sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe [at] lucene > For additional commands, e-mail: java-user-help [at] lucene > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe [at] lucene For additional commands, e-mail: java-user-help [at] lucene
|