- java.lang.Object
-
- org.apache.lucene.misc.document.LazyDocument.LazyField
-
- All Implemented Interfaces:
IndexableField
- Enclosing class:
- LazyDocument
public class LazyDocument.LazyField extends java.lang.Object implements IndexableField
Lazy-loaded field
-
-
Field Summary
Fields Modifier and Type Field Description private int
fieldNum
private java.lang.String
name
(package private) IndexableField
realValue
-
Constructor Summary
Constructors Modifier Constructor Description private
LazyField(java.lang.String name, int fieldNum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BytesRef
binaryValue()
Non-null if this field has a binary valueIndexableFieldType
fieldType()
IndexableFieldType
describing the properties of this field.private IndexableField
getRealValue()
boolean
hasBeenLoaded()
non-private for test only accessInvertableType
invertableType()
Describes how this field should be inverted.java.lang.String
name()
Field namejava.lang.Number
numericValue()
Non-null if this field has a numeric valuejava.io.Reader
readerValue()
Non-null if this field has a Reader valueStoredValue
storedValue()
Stored value.java.lang.String
stringValue()
Non-null if this field has a string valueTokenStream
tokenStream(Analyzer analyzer, TokenStream reuse)
Creates the TokenStream used for indexing this field.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.index.IndexableField
getCharSequenceValue
-
-
-
-
Field Detail
-
name
private java.lang.String name
-
fieldNum
private int fieldNum
-
realValue
volatile IndexableField realValue
-
-
Method Detail
-
hasBeenLoaded
public boolean hasBeenLoaded()
non-private for test only access
-
getRealValue
private IndexableField getRealValue()
-
name
public java.lang.String name()
Description copied from interface:IndexableField
Field name- Specified by:
name
in interfaceIndexableField
-
binaryValue
public BytesRef binaryValue()
Description copied from interface:IndexableField
Non-null if this field has a binary value- Specified by:
binaryValue
in interfaceIndexableField
-
stringValue
public java.lang.String stringValue()
Description copied from interface:IndexableField
Non-null if this field has a string value- Specified by:
stringValue
in interfaceIndexableField
-
readerValue
public java.io.Reader readerValue()
Description copied from interface:IndexableField
Non-null if this field has a Reader value- Specified by:
readerValue
in interfaceIndexableField
-
numericValue
public java.lang.Number numericValue()
Description copied from interface:IndexableField
Non-null if this field has a numeric value- Specified by:
numericValue
in interfaceIndexableField
-
fieldType
public IndexableFieldType fieldType()
Description copied from interface:IndexableField
IndexableFieldType
describing the properties of this field.- Specified by:
fieldType
in interfaceIndexableField
-
tokenStream
public TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)
Description copied from interface:IndexableField
Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.- Specified by:
tokenStream
in interfaceIndexableField
- Parameters:
analyzer
- Analyzer that should be used to create the TokenStreams fromreuse
- TokenStream for a previous instance of this field name. This allows custom field types (like StringField and NumericField) that do not use the analyzer to still have good performance. Note: the passed-in type may be inappropriate, for example if you mix up different types of Fields for the same field name. So it's the responsibility of the implementation to check.- Returns:
- TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed
-
storedValue
public StoredValue storedValue()
Description copied from interface:IndexableField
Stored value. This method is called to populate stored fields and must return a non-null value if the field stored.- Specified by:
storedValue
in interfaceIndexableField
-
invertableType
public InvertableType invertableType()
Description copied from interface:IndexableField
Describes how this field should be inverted. This must return a non-null value if the field indexes terms and postings.- Specified by:
invertableType
in interfaceIndexableField
-
-