lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe <mailer.tho...@gmail.com>
Subject Fastest way to get number of matching documents
Date Mon, 26 Jul 2010 13:18:22 GMT
Hi,

for some queries I'm only interested in the number of matching 
documents. Is there a better/faster way to perform such a query, instead 
of retrieving all TopDocs and counting the number of totalHits [1]?
And is it possible/worthwhile to "deactivate" ranking?

Cheers,
     Philippe

[1]
         TopDocs td= is.search(query, is.maxDoc());
         int result= td.totalHits;

---------------------------------------------------------------------
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