lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <>
Subject Re: Lazy Field Loading
Date Fri, 31 Mar 2006 12:21:19 GMT
OK, how about a vote on this.

I see several ways of implementing the front end to this:

1. Declarative:  On construction of a Document, you declare the Field to 
be Lazy.

2. Implicit:  All fields are Lazy

3. Size of Field.  Pass into IndexReader.document() the size of the 
field above which it will be lazily loaded.  A default size can also be 

4.  By Field name.  Pass in the names of the Fields that you want loaded 


Doug Cutting wrote:
> Grant Ingersoll wrote:
>> My main concern is the semantics of the fieldsStream and whether that 
>> would be closed behind the back of the LazyField implementation.  My 
>> understanding is that as long as the IndexReader is open, this stream 
>> should also be open.  Is that correct?   What am I forgetting about?
> You need to make sure that access to the stream is synchronized, so 
> that one thread doesn't move the file pointer while someone else is 
> reading.  You could use a cloned stream in a ThreadLocal to avoid 
> contention.
> Doug
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:


Grant Ingersoll 
Sr. Software Engineer 
Center for Natural Language Processing 
Syracuse University 
School of Information Studies 
335 Hinds Hall 
Syracuse, NY 13244 
Voice:  315-443-5484 
Fax: 315-443-6886 

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

View raw message