Hi Mike,

I looked at in javadoc:

http://lucene.apache.org/java/2_4_1/api/core/org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query,%20org.apache.lucene.search.Filter,%20int)

and in trunk version of Lucene and I did not find your NOTE.
Can you confirm?
Thanks!


> Date: Tue, 23 Jun 2009 06:49:00 -0400
> Subject: Re: Optimization of memory usage in PriorityQueue
> From: lucene@mikemccandless.com
> To: java-dev@lucene.apache.org
>
> OK I've added a NOTE to the javadocs for this...
>
> Mike
>
> On Mon, Jun 22, 2009 at 8:57 PM, Claudio .<spciclista@hotmail.com> 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: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


See all the ways you can stay connected to friends and family