Class LazyDocument.LazyField
- java.lang.Object
-
- org.apache.lucene.document.LazyDocument.LazyField
-
- All Implemented Interfaces:
IndexableField
- Enclosing class:
- LazyDocument
public class LazyDocument.LazyField extends java.lang.Object implements IndexableField
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BytesRefbinaryValue()Non-null if this field has a binary valuefloatboost()Returns the field's index-time boost.IndexableFieldTypefieldType()IndexableFieldTypedescribing the properties of this field.booleanhasBeenLoaded()non-private for test only accessjava.lang.Stringname()Field namejava.lang.NumbernumericValue()Non-null if this field has a numeric valuejava.io.ReaderreaderValue()Non-null if this field has a Reader valuejava.lang.StringstringValue()Non-null if this field has a string valueTokenStreamtokenStream(Analyzer analyzer)Creates the TokenStream used for indexing this field.
-
-
-
Method Detail
-
hasBeenLoaded
public boolean hasBeenLoaded()
non-private for test only access
-
name
public java.lang.String name()
Description copied from interface:IndexableFieldField name- Specified by:
namein interfaceIndexableField
-
boost
public float boost()
Description copied from interface:IndexableFieldReturns the field's index-time boost.Only fields can have an index-time boost, if you want to simulate a "document boost", then you must pre-multiply it across all the relevant fields yourself.
The boost is used to compute the norm factor for the field. By default, in the
Similarity.computeNorm(FieldInvertState)method, the boost value is multiplied by the length normalization factor and then rounded byDefaultSimilarity.encodeNormValue(float)before it is stored in the index. One should attempt to ensure that this product does not overflow the range of that encoding.It is illegal to return a boost other than 1.0f for a field that is not indexed (
IndexableFieldType.indexed()is false) or omits normalization values (IndexableFieldType.omitNorms()returns true).- Specified by:
boostin interfaceIndexableField- See Also:
Similarity.computeNorm(FieldInvertState),DefaultSimilarity.encodeNormValue(float)
-
binaryValue
public BytesRef binaryValue()
Description copied from interface:IndexableFieldNon-null if this field has a binary value- Specified by:
binaryValuein interfaceIndexableField
-
stringValue
public java.lang.String stringValue()
Description copied from interface:IndexableFieldNon-null if this field has a string value- Specified by:
stringValuein interfaceIndexableField
-
readerValue
public java.io.Reader readerValue()
Description copied from interface:IndexableFieldNon-null if this field has a Reader value- Specified by:
readerValuein interfaceIndexableField
-
numericValue
public java.lang.Number numericValue()
Description copied from interface:IndexableFieldNon-null if this field has a numeric value- Specified by:
numericValuein interfaceIndexableField
-
fieldType
public IndexableFieldType fieldType()
Description copied from interface:IndexableFieldIndexableFieldTypedescribing the properties of this field.- Specified by:
fieldTypein interfaceIndexableField
-
tokenStream
public TokenStream tokenStream(Analyzer analyzer) throws java.io.IOException
Description copied from interface:IndexableFieldCreates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.- Specified by:
tokenStreamin interfaceIndexableField- Parameters:
analyzer- Analyzer that should be used to create the TokenStreams from- Returns:
- TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed
- Throws:
java.io.IOException- Can be thrown while creating the TokenStream
-
-