You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Dmitry Serebrennikov <dm...@earthlink.net> on 2001/10/12 22:42:18 UTC
Some success reports
Greetings,
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.