Interface IndexableField

All Known Implementing Classes:
BinaryDocValuesField, BinaryPoint, DoubleDocValuesField, DoublePoint, DoubleRange, DoubleRangeDocValuesField, FeatureField, Field, FloatDocValuesField, FloatPoint, FloatRange, FloatRangeDocValuesField, InetAddressPoint, InetAddressRange, IntPoint, IntRange, IntRangeDocValuesField, KnnVectorField, LatLonDocValuesField, LatLonPoint, LongPoint, LongRange, LongRangeDocValuesField, NumericDocValuesField, ShapeField.Triangle, SortedDocValuesField, SortedNumericDocValuesField, SortedSetDocValuesField, StoredField, StoredFieldsWriter.MergeVisitor, StringField, TextField, XYDocValuesField, XYPointField

public interface IndexableField
Represents a single field for indexing. IndexWriter consumes Iterable<IndexableField> as a document.
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Method Details

    • name

      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.
      analyzer - Analyzer that should be used to create the TokenStreams from
      reuse - 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.
      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

      String stringValue()
      Non-null if this field has a string value
    • getCharSequenceValue

      default CharSequence getCharSequenceValue()
      Non-null if this field has a string value
    • readerValue

      Reader readerValue()
      Non-null if this field has a Reader value
    • numericValue

      Number numericValue()
      Non-null if this field has a numeric value