lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Serebrennikov <>
Subject Some success reports
Date Fri, 12 Oct 2001 20:42:18 GMT

First, some success reports:
- Made a few Searcher methods public that were previously package-visible:
     int maxDoc() and docFreq(Term)
   This allows easier creation of BitVectors to contain all documents 
without calling IndexReaders directly. While you typically have access 
to IndexReader for an IndexSearcher, MultiSearcher forces you to 
maintain a whole list of them if you need direct access. This way, 
everything can be done from the Searcher / MultiSearcher interface itself.

- Added a few methods to Searcher for efficient counting of search results:
     Searcher.count(Query query)
     Searcher.count(Query query, Filter filter, float minScore)

   For the minScore, only documents that have the score higher than 
minScore are counted. This is implemented in Searcher by constructing a 
BitVector and marking off each found document that meets the criteria, 
then returning the count. For a single IndexSearcher it is at least 
twice as fast as running a Query and then getting the total count from 
the Hits object. For a MultiSearcher, the speed gain is not as 
impressive yet. I think I need to have a more optimized implementation 
for it. Working on that.

Any objections to the above changes? I'll send in the diffs when I'm 
done and the objections / suggestions are incorporated.

View raw message