lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Devon H. O'Dell" <>
Subject Re: Short circuiting Collector
Date Wed, 20 Jul 2011 16:53:41 GMT
2011/7/20 Chris Bamford <>:
> Hi there,
> I have my own Collector implementation which I use for searching, something like this


> Question: is there a way to prevent collect() being called after it has collected its
quota  (i.e. when collecting becomes false)?  On large datasets this would save a lot of
> In this scenario I have no need for sort / ordering etc.

I'd be interested in knowing this as well. My application has the
ability to limit the number of results returned, and I've "solved"
this problem by simply checking whether the number of collected
results exceeds this threshold and simply returning if it has. This
seems fast enough, but it would be nice to be able to notify the
caller that I don't want any more documents somehow.

I was personally unable to find any other workaround for this, and
perhaps my hackish solution will work for you (if you're not already
doing this). But indeed on searches returning several million records,
it's kind of silly to keep spinning.

Kind regards,

Devon H. O'Dell

> Thanks.
> - Chris

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

View raw message