Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class TextFieldMapper.TextFieldType
java.lang.Object
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.SimpleMappedFieldType
org.elasticsearch.index.mapper.TermBasedFieldType
org.elasticsearch.index.mapper.StringFieldType
org.elasticsearch.index.mapper.TextFieldMapper.TextFieldType
- Direct Known Subclasses:
TextFieldMapper.ConstantScoreTextFieldType
- Enclosing class:
TextFieldMapper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.BlockLoaderContext, MappedFieldType.CollapseType, MappedFieldType.FielddataOperation, MappedFieldType.FieldExtractPreference, MappedFieldType.Relation -
Constructor Summary
ConstructorsConstructorDescriptionTextFieldType(String name, boolean isSyntheticSource) TextFieldType(String name, boolean indexed, boolean stored, Map<String, String> meta) TextFieldType(String name, boolean indexed, boolean stored, TextSearchInfo tsi, boolean isSyntheticSource, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate, Map<String, String> meta, boolean eagerGlobalOrdinals, boolean indexPhrases) -
Method Summary
Modifier and TypeMethodDescriptionblockLoader(MappedFieldType.BlockLoaderContext blContext) Returns a loader for ESQL ornullif the field doesn't support ESQL.booleanReturns true if the delegate sub-field can be used for loading.booleanReturns true if the delegate sub-field can be used for querying only (ie.booleanReturns true if the delegate sub-field can be used for querying only (ie.booleanbooleanfielddataBuilder(FieldDataContext fieldDataContext) Return a fielddata builder for this fieldorg.apache.lucene.queries.intervals.IntervalsSourcefuzzyIntervals(String term, int maxDistance, int prefixLength, boolean transpositions, SearchExecutionContext context) Create a fuzzyIntervalsSourcefor the given term.org.elasticsearch.index.mapper.TextFieldMapper.PrefixFieldTypestatic booleanhasGaps(org.apache.lucene.analysis.TokenStream stream) booleanReturns true if the field is aggregatable.booleanorg.apache.lucene.search.QuerymultiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements, SearchExecutionContext context) org.apache.lucene.search.QueryphrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions, SearchExecutionContext context) org.apache.lucene.search.QueryphraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePosIncrements, SearchExecutionContext context) org.apache.lucene.queries.intervals.IntervalsSourceprefixIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context) Create anIntervalsSourcefor the given prefix.org.apache.lucene.search.QueryprefixQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context) org.apache.lucene.queries.intervals.IntervalsSourcerangeIntervals(org.apache.lucene.util.BytesRef lowerTerm, org.apache.lucene.util.BytesRef upperTerm, boolean includeLower, boolean includeUpper, SearchExecutionContext context) Create a rangeIntervalsSourcefor the given rangesorg.apache.lucene.queries.intervals.IntervalsSourceregexpIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context) Create a regexpIntervalsSourcefor the given pattern.voidsetFielddata(boolean fielddata) voidsetFielddata(boolean fielddata, org.elasticsearch.index.mapper.TextFieldMapper.FielddataFrequencyFilter filter) org.apache.lucene.queries.spans.SpanQueryspanPrefixQuery(String value, org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context) org.apache.lucene.queries.intervals.IntervalsSourcetermIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context) Create anIntervalsSourcefor the given term.typeName()Returns the name of this type, as would be specified in mapping propertiesvalueFetcher(SearchExecutionContext context, String format) Create a helper class to fetch field values during theFetchFieldsPhase.org.apache.lucene.queries.intervals.IntervalsSourcewildcardIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context) Create a wildcardIntervalsSourcefor the given pattern.Methods inherited from class org.elasticsearch.index.mapper.StringFieldType
fuzzyQuery, normalizedWildcardQuery, normalizeWildcardPattern, rangeQuery, regexpQuery, wildcardQuery, wildcardQueryMethods inherited from class org.elasticsearch.index.mapper.TermBasedFieldType
indexedValueForSearch, mayExistInIndex, termQuery, termQueryCaseInsensitive, termsQueryMethods inherited from class org.elasticsearch.index.mapper.SimpleMappedFieldType
rangeQueryMethods inherited from class org.elasticsearch.index.mapper.MappedFieldType
automatonQuery, checkNoFormat, checkNoTimeZone, collapseType, dimensions, distanceFeatureQuery, docValueFormat, existsQuery, extractTerm, failIfNoDocValues, failIfNotIndexed, failIfNotIndexedNorDocValuesFallback, familyTypeName, fieldHasValue, fuzzyQuery, getDefaultHighlighter, getMetricType, getTerms, getTextSearchInfo, hasDocValues, hasScriptValues, isDimension, isFieldWithinQuery, isIndexed, isSearchable, isStored, isVectorEmbedding, meta, name, pointReaderIfPossible, prefixQuery, validateMatchedRoutingPath, valueForDisplay, wildcardLikeQuery, wildcardQuery
-
Constructor Details
-
TextFieldType
public TextFieldType(String name, boolean indexed, boolean stored, TextSearchInfo tsi, boolean isSyntheticSource, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate, Map<String, String> meta, boolean eagerGlobalOrdinals, boolean indexPhrases) -
TextFieldType
-
TextFieldType
-
-
Method Details
-
fielddata
public boolean fielddata() -
eagerGlobalOrdinals
public boolean eagerGlobalOrdinals()- Overrides:
eagerGlobalOrdinalsin classMappedFieldType- 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
Description copied from class:MappedFieldTypeReturns the name of this type, as would be specified in mapping properties- Specified by:
typeNamein classMappedFieldType
-
valueFetcher
Description copied from class:MappedFieldTypeCreate a helper class to fetch field values during theFetchFieldsPhase. New field types must implement this method in order to support the search 'fields' option. Except for metadata fields, field types should not throwUnsupportedOperationExceptionsince this could cause a search retrieving multiple fields (like "fields": ["*"]) to fail.- Specified by:
valueFetcherin classMappedFieldType
-
prefixQuery
public org.apache.lucene.search.Query prefixQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context) - Overrides:
prefixQueryin classStringFieldType
-
spanPrefixQuery
public org.apache.lucene.queries.spans.SpanQuery spanPrefixQuery(String value, org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context) - Overrides:
spanPrefixQueryin classMappedFieldType
-
termIntervals
public org.apache.lucene.queries.intervals.IntervalsSource termIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context) Description copied from class:MappedFieldTypeCreate anIntervalsSourcefor the given term.- Overrides:
termIntervalsin classMappedFieldType
-
prefixIntervals
public org.apache.lucene.queries.intervals.IntervalsSource prefixIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context) Description copied from class:MappedFieldTypeCreate anIntervalsSourcefor the given prefix.- Overrides:
prefixIntervalsin classMappedFieldType
-
fuzzyIntervals
public org.apache.lucene.queries.intervals.IntervalsSource fuzzyIntervals(String term, int maxDistance, int prefixLength, boolean transpositions, SearchExecutionContext context) Description copied from class:MappedFieldTypeCreate a fuzzyIntervalsSourcefor the given term.- Overrides:
fuzzyIntervalsin classMappedFieldType
-
wildcardIntervals
public org.apache.lucene.queries.intervals.IntervalsSource wildcardIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context) Description copied from class:MappedFieldTypeCreate a wildcardIntervalsSourcefor the given pattern.- Overrides:
wildcardIntervalsin classMappedFieldType
-
regexpIntervals
public org.apache.lucene.queries.intervals.IntervalsSource regexpIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context) Description copied from class:MappedFieldTypeCreate a regexpIntervalsSourcefor the given pattern.- Overrides:
regexpIntervalsin classMappedFieldType
-
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:MappedFieldTypeCreate a rangeIntervalsSourcefor the given ranges- Overrides:
rangeIntervalsin classMappedFieldType
-
phraseQuery
public org.apache.lucene.search.Query phraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePosIncrements, SearchExecutionContext context) throws IOException - Overrides:
phraseQueryin classMappedFieldType- 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:
multiPhraseQueryin classMappedFieldType- 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:
phrasePrefixQueryin classMappedFieldType- Throws:
IOException
-
hasGaps
- Throws:
IOException
-
isAggregatable
public boolean isAggregatable()Description copied from class:MappedFieldTypeReturns true if the field is aggregatable.- Overrides:
isAggregatablein classMappedFieldType
-
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. isIndexed must be true) -
canUseSyntheticSourceDelegateForQueryingEquality
Returns true if the delegate sub-field can be used for querying only (ie. isIndexed must be true) -
blockLoader
Description copied from class:MappedFieldTypeReturns a loader for ESQL ornullif the field doesn't support ESQL.- Overrides:
blockLoaderin classMappedFieldType
-
fielddataBuilder
Description copied from class:MappedFieldTypeReturn a fielddata builder for this field- Overrides:
fielddataBuilderin classMappedFieldType- Parameters:
fieldDataContext- the context for the fielddata
-
isSyntheticSource
public boolean isSyntheticSource() -
syntheticSourceDelegate
-