On 06/29/2012 02:55 PM, Mike Sokolov wrote:
On 06/29/2012 02:17 PM, Robert Muir wrote:
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.
I can't do that because am writing a middle layer that is called by a
consumer that I can't change and that doesn't know anything about
Lucene. I need to implement an Iterator-style interface. My consumer
will simply call next() repeatedly, and then stop at some point, and
close() me so I can clean up.
So to satisfy that I think I would have to collect all results.
Or the other solution I considered was a multi-threaded collector, but
all-in-all it seemed simplest to write a pull-style iterator :)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org