lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <>
Subject Re: Query, Searcher, Weight, Similarity = ?
Date Fri, 29 Jun 2012 18:17:43 GMT
On Fri, Jun 29, 2012 at 2:12 PM, Mike Sokolov <> wrote:
> This has been elucidating, thanks!
> On a related topic:
> I need the ability to pull results lazily, so that I can decide whether to
> terminate the search iteration early, and ultimately I need to delegate that
> decision to callers of *my* API.

The typical solution to this is to just throw an exception from your
collector when you are satisfied: see TimeLimitingCollector.

> Basically what I wanted was a method nextDoc() that I could call repeatedly
> to retrieve all of the docIDs returned by the search, or at any rate, as
> many as needed.

the push and pull are no different here I think, though I dont know
your use case. When your collector is satisfied, just throw an
exception :)

> Last question: what order are documents returned in if you create Scorers
> with ordered=true - is that always ascending docID order?

Yes, if you allow for out-of-order scoring, currently only
BooleanScorer will do anything with that (i think only when its a
top-level scorer), returning out-of-order hits within each window of
2k docs


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

View raw message