Package org.apache.lucene.index
Interface IndexableField
-
- All Known Implementing Classes:
BigIntegerPoint,BinaryDocValuesField,BinaryPoint,BinaryRangeDocValuesField,CollationDocValuesField,ContextSuggestField,DoubleDocValuesField,DoublePoint,DoubleRange,DoubleRangeDocValuesField,FeatureField,Field,FloatDocValuesField,FloatPoint,FloatRange,FloatRangeDocValuesField,HalfFloatPoint,ICUCollationDocValuesField,InetAddressPoint,InetAddressRange,IntPoint,IntRange,IntRangeDocValuesField,LatLonBoundingBox,LatLonDocValuesField,LatLonPoint,LazyDocument.LazyField,LongPoint,LongRange,LongRangeDocValuesField,NumericDocValuesField,ShapeField.Triangle,SortedDocValuesField,SortedNumericDocValuesField,SortedSetDocValuesField,SortingStoredFieldsConsumer.CopyVisitor,StoredField,StoredFieldsWriter.MergeVisitor,StringField,SuggestField,TextField,XYDocValuesField,XYPointField
public interface IndexableFieldRepresents 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 BytesRefbinaryValue()Non-null if this field has a binary valueIndexableFieldTypefieldType()IndexableFieldTypedescribing the properties of this field.default java.lang.CharSequencegetCharSequenceValue()Non-null if this field has a string valuejava.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, TokenStream reuse)Creates the TokenStream used for indexing this field.
-
-
-
Method Detail
-
name
java.lang.String name()
Field name
-
fieldType
IndexableFieldType fieldType()
IndexableFieldTypedescribing 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
-
-