You might try lazy loading. See
IndexReader.*document<file:///C:/lucene-2.1.0/docs/api/org/apache/lucene/index/IndexReader.html#document%28int,%20org.apache.lucene.document.FieldSelector%29>
*(int n, 
FieldSelector<file:///C:/lucene-2.1.0/docs/api/org/apache/lucene/document/FieldSelector.html>
 fieldSelector),
particularly the FieldSelector. It allows you to selectively load only the
fields you want.

Otherwise, I'm sure if you looked in the unit tests you'd find examples
of how to use FieldCache. If your fields are really that huge, I'm not
sure how FieldCache would help you all that much before you'd run out
of memory. Perhaps you could outline your problem in more detail
and get some better answers.....

Best
Erick

On 7/24/07, Askar Zaidi <[EMAIL PROTECTED]> wrote:
>
> Hey Guys,
>
> From what I understand, FieldCache is used to store only the field
> required
> for search. I am using a Document object and then using doc.get("item").
> One
> of my fields is HUGE, so using Document will slow things down.
>
> How can I use FieldCache ? an example ?
>
> thanks,
> AZ
>

Reply via email to