On Fri, Jun 29, 2012 at 2:12 PM, Mike Sokolov <soko...@ifactory.com> 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 -- lucidimagination.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org