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 jafarim <ja...@gmail.com> on 2007/04/04 14:56:21 UTC

Field.lazy setter method?

Hi
I wonder why there is not setter method for the "lazy" member variable in
Field class. Does that mean the propoerty is nominal and setting it does not
have any effect, or am I missing some point?
Any way, is there any way to tell lucene that a field is to be lazy-loaded,
from the very beginning of field construction?

--jaf

Re: Field.lazy setter method?

Posted by jafarim <ja...@gmail.com>.
So, what's the usage of this propoerty in the Field class?

On 4/4/07, Yonik Seeley <yo...@apache.org> wrote:
>
> On 4/4/07, jafarim <ja...@gmail.com> wrote:
> > Any way, is there any way to tell lucene that a field is to be
> lazy-loaded,
> > from the very beginning of field construction?
>
> No, that data is not stored in the index.
> Lazy field loading is specified only when retrieving the stored fields
> of a document, and it can be different each time one requests a
> document.
>
> -Yonik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Field.lazy setter method?

Posted by Yonik Seeley <yo...@apache.org>.
On 4/4/07, jafarim <ja...@gmail.com> wrote:
> Any way, is there any way to tell lucene that a field is to be lazy-loaded,
> from the very beginning of field construction?

No, that data is not stored in the index.
Lazy field loading is specified only when retrieving the stored fields
of a document, and it can be different each time one requests a
document.

-Yonik

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


Re: Field.lazy setter method?

Posted by Grant Ingersoll <gs...@apache.org>.
Lazy loading is handled through the FieldSelector interface on  
IndexReader.doc() and some variations.  There is nothing special that  
need be done during indexing to mark a field as lazy.  The isLazy  
method merely lets you know later, after loading a Document, if the  
field is, indeed, lazy.  One caveat, lazy fields become undefined if  
the underlying IndexReader is closed before accessing the field.   
Once a lazy field is loaded, however, this is no longer an issue, as  
the field value stays in memory.

-Grant

On Apr 4, 2007, at 8:56 AM, jafarim wrote:

> Hi
> I wonder why there is not setter method for the "lazy" member  
> variable in
> Field class. Does that mean the propoerty is nominal and setting it  
> does not
> have any effect, or am I missing some point?
> Any way, is there any way to tell lucene that a field is to be lazy- 
> loaded,
> from the very beginning of field construction?
>
> --jaf

--------------------------
Grant Ingersoll
Center for Natural Language Processing
http://www.cnlp.org

Read the Lucene Java FAQ at http://wiki.apache.org/jakarta-lucene/ 
LuceneFAQ



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