Class TextFieldMapper.TextFieldType

Direct Known Subclasses:
TextFieldMapper.ConstantScoreTextFieldType
Enclosing class:
TextFieldMapper

public static class TextFieldMapper.TextFieldType extends StringFieldType
  • Constructor Details

  • Method Details

    • fielddata

      public boolean fielddata()
    • eagerGlobalOrdinals

      public boolean eagerGlobalOrdinals()
      Overrides:
      eagerGlobalOrdinals in class MappedFieldType
      Returns:
      if this field type should load global ordinals eagerly
    • 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 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, 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(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)
      Overrides:
      prefixQuery in class StringFieldType
    • spanPrefixQuery

      public org.apache.lucene.queries.spans.SpanQuery spanPrefixQuery(String value, org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context)
      Overrides:
      spanPrefixQuery in class MappedFieldType
    • termIntervals

      public org.apache.lucene.queries.intervals.IntervalsSource termIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Create an IntervalsSource for the given term.
      Overrides:
      termIntervals in class MappedFieldType
    • prefixIntervals

      public org.apache.lucene.queries.intervals.IntervalsSource prefixIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Create an IntervalsSource for the given prefix.
      Overrides:
      prefixIntervals in class MappedFieldType
    • fuzzyIntervals

      public org.apache.lucene.queries.intervals.IntervalsSource fuzzyIntervals(String term, int maxDistance, int prefixLength, boolean transpositions, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Create a fuzzy IntervalsSource for the given term.
      Overrides:
      fuzzyIntervals in class MappedFieldType
    • wildcardIntervals

      public org.apache.lucene.queries.intervals.IntervalsSource wildcardIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Create a wildcard IntervalsSource for the given pattern.
      Overrides:
      wildcardIntervals in class MappedFieldType
    • regexpIntervals

      public org.apache.lucene.queries.intervals.IntervalsSource regexpIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Create a regexp IntervalsSource for the given pattern.
      Overrides:
      regexpIntervals in class MappedFieldType
    • rangeIntervals

      public org.apache.lucene.queries.intervals.IntervalsSource rangeIntervals(org.apache.lucene.util.BytesRef lowerTerm, org.apache.lucene.util.BytesRef upperTerm, boolean includeLower, boolean includeUpper, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Create a range IntervalsSource for the given ranges
      Overrides:
      rangeIntervals in class MappedFieldType
    • phraseQuery

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

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

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

      public static boolean hasGaps(org.apache.lucene.analysis.TokenStream stream) throws IOException
      Throws:
      IOException
    • isAggregatable

      public boolean isAggregatable()
      Description copied from class: MappedFieldType
      Returns true if the field is aggregatable.
      Overrides:
      isAggregatable in class MappedFieldType
    • canUseSyntheticSourceDelegateForLoading

      public boolean canUseSyntheticSourceDelegateForLoading()
      Returns true if the delegate sub-field can be used for loading and querying (ie. either isIndexed or isStored is true)
    • canUseSyntheticSourceDelegateForQuerying

      public boolean canUseSyntheticSourceDelegateForQuerying()
      Returns true if the delegate sub-field can be used for querying only (ie. isIndexed must be true)
    • blockLoader

      public BlockLoader blockLoader(MappedFieldType.BlockLoaderContext blContext)
      Description copied from class: MappedFieldType
      Returns a loader for ESQL or null if the field doesn't support ESQL.
      Overrides:
      blockLoader in class MappedFieldType
    • fielddataBuilder

      public IndexFieldData.Builder fielddataBuilder(FieldDataContext fieldDataContext)
      Description copied from class: MappedFieldType
      Return a fielddata builder for this field
      Overrides:
      fielddataBuilder in class MappedFieldType
      Parameters:
      fieldDataContext - the context for the fielddata
    • isSyntheticSource

      public boolean isSyntheticSource()
    • syntheticSourceDelegate

      public KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate()