lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Count the total # of docs in the index?
Date Sun, 07 Aug 2005 15:06:34 GMT
You've asked to different questions - you can use IndexReader.numDocs 
() to find the total number of documents.

Within a date range - how did you index the dates?  If the dates are  
in lexicographical order, you can walk all the terms in that range  
using TermEnum from IndexReader.terms(Term t) where t is the first  
term in the date range.  You will then need to get the termDocs(t)  
for each of the matching terms.  So it is possible without a search.

     Erik


On Aug 7, 2005, at 7:47 AM, Ben wrote:

> Hi
>
> Is it possible to count the total number of documents in the index
> without requesting a search? I would like to count the total documents
> in the index within a date range.
>
> Thanks,
> Ben
>
> ---------------------------------------------------------------------
> 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