Class TextFieldMapper.TextFieldType

Enclosing class:
TextFieldMapper

public static class TextFieldMapper.TextFieldType
extends StringFieldType
  • Constructor Details

    • TextFieldType

      public TextFieldType​(java.lang.String name, boolean indexed, boolean stored, TextSearchInfo tsi, java.util.Map<java.lang.String,​java.lang.String> meta)
    • TextFieldType

      public TextFieldType​(java.lang.String name, boolean indexed, boolean stored, java.util.Map<java.lang.String,​java.lang.String> meta)
    • TextFieldType

      public TextFieldType​(java.lang.String name)
  • Method Details

    • fielddata

      public boolean fielddata()
    • setFielddata

      public void setFielddata​(boolean fielddata, org.elasticsearch.index.mapper.TextFieldMapper.FielddataFrequencyFilter filter)
    • setFielddata

      public void setFielddata​(boolean fielddata)
    • getPrefixFieldType

      public org.elasticsearch.index.mapper.TextFieldMapper.PrefixFieldType getPrefixFieldType()
    • typeName

      public java.lang.String typeName()
      Description copied from class: MappedFieldType
      Returns the name of this type, as would be specified in mapping properties
      Specified by:
      typeName in class MappedFieldType
    • valueFetcher

      public ValueFetcher valueFetcher​(SearchExecutionContext context, java.lang.String format)
      Description copied from class: MappedFieldType
      Create a helper class to fetch field values during the FetchFieldsPhase.

      New field types must implement this method in order to support the search 'fields' option. Except for metadata fields, field types should not throw UnsupportedOperationException since this could cause a search retrieving multiple fields (like "fields": ["*"]) to fail.

      Specified by:
      valueFetcher in class MappedFieldType
    • prefixQuery

      public org.apache.lucene.search.Query prefixQuery​(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)
      Overrides:
      prefixQuery in class StringFieldType
    • spanPrefixQuery

      public org.apache.lucene.search.spans.SpanQuery spanPrefixQuery​(java.lang.String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context)
      Overrides:
      spanPrefixQuery in class MappedFieldType
    • intervals

      public org.apache.lucene.queries.intervals.IntervalsSource intervals​(java.lang.String text, int maxGaps, boolean ordered, NamedAnalyzer analyzer, boolean prefix) throws java.io.IOException
      Description copied from class: MappedFieldType
      Create an IntervalsSource to be used for proximity queries
      Overrides:
      intervals in class MappedFieldType
      Throws:
      java.io.IOException
    • phraseQuery

      public org.apache.lucene.search.Query phraseQuery​(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePosIncrements) throws java.io.IOException
      Overrides:
      phraseQuery in class MappedFieldType
      Throws:
      java.io.IOException
    • multiPhraseQuery

      public org.apache.lucene.search.Query multiPhraseQuery​(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements) throws java.io.IOException
      Overrides:
      multiPhraseQuery in class MappedFieldType
      Throws:
      java.io.IOException
    • phrasePrefixQuery

      public org.apache.lucene.search.Query phrasePrefixQuery​(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions) throws java.io.IOException
      Overrides:
      phrasePrefixQuery in class MappedFieldType
      Throws:
      java.io.IOException
    • hasGaps

      public static boolean hasGaps​(org.apache.lucene.analysis.TokenStream stream) throws java.io.IOException
      Throws:
      java.io.IOException
    • fielddataBuilder

      public IndexFieldData.Builder fielddataBuilder​(java.lang.String fullyQualifiedIndexName, java.util.function.Supplier<SearchLookup> searchLookup)
      Description copied from class: MappedFieldType
      Return a fielddata builder for this field
      Overrides:
      fielddataBuilder in class MappedFieldType
      Parameters:
      fullyQualifiedIndexName - the name of the index this field-data is build for
      searchLookup - a SearchLookup supplier to allow for accessing other fields values in the context of runtime fields