lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Non scored results
Date Sat, 22 Oct 2005 13:43:26 GMT
On Friday 21 October 2005 15:16, Yonik Seeley wrote:
> It can...
> By the time the hitcollector is called, the documents are already scored, so
> you don't save any time there. But since they haven't been sorted yet, you
> do save the time it would take to put all the hits through the priority
> queue to find the top "n".
> -Yonik
> On 10/21/05, Volodymyr Bychkoviak <> wrote:
> >
> > Hello all.
> >
> > If I need non scored results can I use
> >,HitCollector) method and store bitset of found
> > documents.
> > will it give me some speed improvement?

With the default scoring methods, there is hardly any gain in doing this.
Nevertheless, to try this out, you need a Scorer for the query via 
Query.weight(Searcher).scorer(IndexReader) and then use and 
Scorer.doc() only, ie. do not use Scorer.score().
The searcher can be opened on the index reader to have both available.

In case you have an OR like boolean query, with optional clauses only,
it may be faster iterate over the documents of each clause seperately
to set the document bits.

Paul Elschot

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

View raw message