lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Optimization of memory usage in PriorityQueue
Date Tue, 23 Jun 2009 10:49:00 GMT
OK I've added a NOTE to the javadocs for this...


On Mon, Jun 22, 2009 at 8:57 PM, Claudio .<> wrote:
>>> I think the common use case of TopScoreDocCollector is to request 10
>>> results, then ask for 20 and so on. You ask for N results because you want
>>> to display them, or manipulate them in some way.
>>> However, if we do add this to the base PQ, it means an extra check for
>>> every put() call. We've tried very hard recently to remove 'if' checks in
>>> TopScoreDocCollector and TopFieldCollector, so adding one back does not seem
>>> very appealing to me, especially since I IMO the use case of requesting 10K
>>> results w/o knowing first there are more or so that match the query, is not
>>> so common.
> Hi serera,
> Ok, I understood.
> I think the Lucene team could add a warning in the javadoc, warning that
> will be created internally an Object[] with the size of top.
> I thought that the Lucene would create internally an array with the number
> of results.
> The users can set high values of top (like me) without knowing that they are
> wasting memory.
> Thanks!
> ________________________________
> check out the rest of the Windows Live™. More than mail–Windows Live™ goes
> way beyond your inbox. More than messages

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

View raw message