lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: Number of documents in an index with filter
Date Sun, 27 May 2007 10:31:17 GMT

> 
> 
> Greetings,
> 
> I would like to add the number of possible hits in my 
> queries, for example,
> "found 18 hits out of a possible 245,000 documents".  I am 
> assuming that
> IndexReader.numDocs() is the best way to get this value.
> 
> However, I would like to use a filter as part of the query.  
> What is the
> most efficient way to get the total number of documents given 
> a filter on a
> query?

can't you use yourFilter.bits(reader).cardinality() to get the number of items in the index
after the filter?

Regards Ard 

> 
> Thanks,
> J
> 
> 
> ---------------------------------------------------------------------
> 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