lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: fast Result Count
Date Tue, 09 Feb 2010 18:04:38 GMT
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@gmx.net> 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@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message