lucene-java-user mailing list archives

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

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?


         TopDocs td=, is.maxDoc());
         int result= td.totalHits;

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message