-
- All Known Implementing Classes:
BigIntegerPoint
,BinaryDocValuesField
,BinaryPoint
,BinaryRangeDocValuesField
,CollationDocValuesField
,ContextSuggestField
,DoubleDocValuesField
,DoubleField
,DoublePoint
,DoubleRange
,DoubleRangeDocValuesField
,FeatureField
,Field
,FloatDocValuesField
,FloatField
,FloatPoint
,FloatRange
,FloatRangeDocValuesField
,Geo3DDocValuesField
,Geo3DPoint
,HalfFloatPoint
,ICUCollationDocValuesField
,IndexingChain.ReservedField
,InetAddressPoint
,InetAddressRange
,IntField
,IntPoint
,IntRange
,IntRangeDocValuesField
,KeywordField
,KnnByteVectorField
,KnnFloatVectorField
,KnnVectorField
,LatLonBoundingBox
,LatLonDocValuesField
,LatLonPoint
,LatLonShapeDocValuesField
,LazyDocument.LazyField
,LongField
,LongPoint
,LongRange
,LongRangeDocValuesField
,NumericDocValuesField
,ShapeDocValuesField
,ShapeField.Triangle
,SortedDocValuesField
,SortedNumericDocValuesField
,SortedSetDocValuesField
,StoredField
,StringField
,SuggestField
,TextField
,XYDocValuesField
,XYPointField
,XYShapeDocValuesField
public interface IndexableField
Represents a single field for indexing. IndexWriter consumes Iterable<IndexableField> as a document.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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.default java.lang.CharSequence
getCharSequenceValue()
Non-null if this field has a string valueInvertableType
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.
-
-
-
Method Detail
-
name
java.lang.String name()
Field name
-
fieldType
IndexableFieldType fieldType()
IndexableFieldType
describing the properties of this field.
-
tokenStream
TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)
Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.- 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
-
binaryValue
BytesRef binaryValue()
Non-null if this field has a binary value
-
stringValue
java.lang.String stringValue()
Non-null if this field has a string value
-
getCharSequenceValue
default java.lang.CharSequence getCharSequenceValue()
Non-null if this field has a string value
-
readerValue
java.io.Reader readerValue()
Non-null if this field has a Reader value
-
numericValue
java.lang.Number numericValue()
Non-null if this field has a numeric value
-
storedValue
StoredValue storedValue()
Stored value. This method is called to populate stored fields and must return a non-null value if the field stored.
-
invertableType
InvertableType invertableType()
Describes how this field should be inverted. This must return a non-null value if the field indexes terms and postings.
-
-