You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by java_is_everything <aj...@gmail.com> on 2008/06/26 07:09:44 UTC

How to retrieve number of documents based on a query ?

Hi all.

Is there a way to obtain the number of documents in the Lucene index
(2.0.0), having a particular term indexed, much like what we do in a
database ?

Looking forward to a reply.

Ajay Garg
-- 
View this message in context: http://www.nabble.com/How-to-retrieve-number-of-documents-based-on-a-query---tp18126682p18126682.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: How to retrieve number of documents based on a query ?

Posted by Daniel Noll <da...@nuix.com>.
On Thursday 26 June 2008 15:09:44 java_is_everything wrote:
> Hi all.
>
> Is there a way to obtain the number of documents in the Lucene index
> (2.0.0), having a particular term indexed, much like what we do in a
> database ?

I suspect the normal way is a HitCollector which does nothing but increment a 
counter for each hit.

BTW I hope you're not really running 2.0.0, as that is ancient.

Daniel

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