Class TextFieldMapper.TextFieldType

Direct Known Subclasses:
TextFieldMapper.ConstantScoreTextFieldType
Enclosing class:
TextFieldMapper

public static class TextFieldMapper.TextFieldType extends TextFamilyFieldType
  • Constructor Details

    • TextFieldType

      public TextFieldType(String name, boolean indexed, boolean stored, TextSearchInfo tsi, boolean isSyntheticSource, boolean isWithinMultiField, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate, Map<String,String> meta, boolean eagerGlobalOrdinals, boolean indexPhrases)
    • TextFieldType

      public TextFieldType(String name, boolean indexed, boolean stored, Map<String,String> meta)
    • TextFieldType

      public TextFieldType(String name, boolean isSyntheticSource, boolean isWithinMultiField)
    • TextFieldType

      public TextFieldType(String name, boolean isSyntheticSource, boolean isWithinMultiField, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate)
  • 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: TextFamilyFieldType
      Create an IntervalsSource for the given term.
      Overrides:
      termIntervals in class TextFamilyFieldType
    • prefixIntervals

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

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

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

      public org.apache.lucene.queries.intervals.IntervalsSource regexpIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context)
      Description copied from class: TextFamilyFieldType
      Create a regexp IntervalsSource for the given pattern.
      Overrides:
      regexpIntervals in class TextFamilyFieldType
    • 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: TextFamilyFieldType
      Create a range IntervalsSource for the given ranges
      Overrides:
      rangeIntervals in class TextFamilyFieldType
    • 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. A delegate by definition must have doc_values or be stored so most of the time it can be used for loading.
    • canUseSyntheticSourceDelegateForQuerying

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

      public boolean canUseSyntheticSourceDelegateForSyntheticSource(String value)
      Returns whether this field can use its delegate keyword field for synthetic source.
    • canUseSyntheticSourceDelegateForQueryingEquality

      public boolean canUseSyntheticSourceDelegateForQueryingEquality(String str)
      Returns true if the delegate sub-field can be used for querying only (ie. isSearchable must be true)
    • storeFieldForSyntheticSource

      public boolean storeFieldForSyntheticSource(IndexVersion indexCreatedVersion)
    • 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
    • syntheticSourceDelegate

      public Optional<KeywordFieldMapper.KeywordFieldType> syntheticSourceDelegate()