You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by fujian <fu...@nokia.com> on 2010/06/09 17:46:33 UTC

why lucene loads field value for every doc (not only the matched docs) when doing sort?


Hello,

I'm using lucene 2.9.0 and ran into OutOfMemory error when doing a search
with sort on a big index. After a bit research, I found that when doing sort
lucene loads the field value for all docs in the index into memory, not the
matched ones only. 

Just wondering why this? maybe for the performance? Is there a way to avoid
this? I mean maybe lucene should give users another option not to load
values for all docs.

Thanks,
-Fujian
-- 
View this message in context: http://lucene.472066.n3.nabble.com/why-lucene-loads-field-value-for-every-doc-not-only-the-matched-docs-when-doing-sort-tp882598p882598.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: why lucene loads field value for every doc (not only the matched docs) when doing sort?

Posted by Ian Lea <ia...@gmail.com>.
For performance. There is a one-off initial hit then things get quick.

--
Ian.


On Wed, Jun 9, 2010 at 4:46 PM, fujian <fu...@nokia.com> wrote:
>
>
> Hello,
>
> I'm using lucene 2.9.0 and ran into OutOfMemory error when doing a search
> with sort on a big index. After a bit research, I found that when doing sort
> lucene loads the field value for all docs in the index into memory, not the
> matched ones only.
>
> Just wondering why this? maybe for the performance? Is there a way to avoid
> this? I mean maybe lucene should give users another option not to load
> values for all docs.
>
> Thanks,
> -Fujian
> --
> View this message in context: http://lucene.472066.n3.nabble.com/why-lucene-loads-field-value-for-every-doc-not-only-the-matched-docs-when-doing-sort-tp882598p882598.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org