- java.lang.Object
-
- org.apache.lucene.misc.document.LazyDocument
-
public class LazyDocument extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
LazyDocument.LazyField
Lazy-loaded field
-
Field Summary
Fields Modifier and Type Field Description private Document
doc
private int
docID
private java.util.Set<java.lang.String>
fieldNames
private IntObjectHashMap<java.util.List<LazyDocument.LazyField>>
fields
private IndexReader
reader
-
Constructor Summary
Constructors Constructor Description LazyDocument(IndexReader reader, int docID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
fetchRealValues(java.lang.String name, int fieldNum)
(package private) Document
getDocument()
non-private for test only accessIndexableField
getField(FieldInfo fieldInfo)
Creates a StorableField whose value will be lazy loaded if and when it is used.
-
-
-
Field Detail
-
reader
private final IndexReader reader
-
docID
private final int docID
-
doc
private Document doc
-
fields
private IntObjectHashMap<java.util.List<LazyDocument.LazyField>> fields
-
fieldNames
private java.util.Set<java.lang.String> fieldNames
-
-
Constructor Detail
-
LazyDocument
public LazyDocument(IndexReader reader, int docID)
-
-
Method Detail
-
getField
public IndexableField getField(FieldInfo fieldInfo)
Creates a StorableField 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, StorableField instances referring to the same underlying StorableField instance.
The lazy loading of field values from all instances of StorableField objects returned by this method are all backed by a single StoredDocument per LazyDocument instance.
-
getDocument
Document getDocument()
non-private for test only access
-
fetchRealValues
private void fetchRealValues(java.lang.String name, int fieldNum)
-
-