org.apache.lucene.document
Class LazyDocument

java.lang.Object
  extended by org.apache.lucene.document.LazyDocument

public class LazyDocument
extends Object

Defers actually loading a field's value until you ask for it. You must not use the returned Field instances after the provided reader has been closed.

See Also:
getField(org.apache.lucene.index.FieldInfo)

Nested Class Summary
 class LazyDocument.LazyField
           
 
Constructor Summary
LazyDocument(IndexReader reader, int docID)
           
 
Method Summary
 IndexableField getField(FieldInfo fieldInfo)
          Creates an IndexableField whose value will be lazy loaded if and when it is used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyDocument

public LazyDocument(IndexReader reader,
                    int docID)
Method Detail

getField

public IndexableField getField(FieldInfo fieldInfo)
Creates an IndexableField whose value will be lazy loaded if and when it is used.

NOTE: This method must be called once for each value of the field name specified in sequence that the values exist. This method may not be used to generate multiple, lazy, IndexableField instances refering to the same underlying IndexableField instance.

The lazy loading of field values from all instances of IndexableField objects returned by this method are all backed by a single Document per LazyDocument instance.



Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.