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.TextFamilyFieldType
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.TextFamilyFieldType
TextFamilyFieldType.ConditionalBlockLoaderWithIgnoreFieldNested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.BlockLoaderContext, MappedFieldType.CollapseType, MappedFieldType.FielddataOperation, MappedFieldType.FieldExtractPreference, MappedFieldType.Relation -
Field Summary
Fields inherited from class org.elasticsearch.index.mapper.TextFamilyFieldType
FALLBACK_FIELD_NAME_SUFFIXFields inherited from class org.elasticsearch.index.mapper.TermBasedFieldType
textSearchInfoFields inherited from class org.elasticsearch.index.mapper.MappedFieldType
indexType -
Constructor Summary
ConstructorsConstructorDescriptionTextFieldType(String name, boolean isSyntheticSource, boolean isWithinMultiField) TextFieldType(String name, boolean indexed, boolean stored, boolean hasDocValues, TextSearchInfo tsi, boolean isSyntheticSource, boolean isWithinMultiField, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate, Map<String, String> meta, boolean eagerGlobalOrdinals, boolean indexPhrases, IndexVersion indexCreatedVersion, boolean usesBinaryDocValuesForFallbackFields, boolean usesBinaryDocValues) TextFieldType(String name, boolean indexed, boolean stored, Map<String, String> meta) TextFieldType(String name, boolean isSyntheticSource, boolean isWithinMultiField, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate) TextFieldType(String name, boolean indexed, boolean stored, TextSearchInfo tsi, boolean isSyntheticSource, boolean isWithinMultiField, 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.booleanReturns whether this field can use its delegate keyword field for synthetic source.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.booleanReturns true if the field is searchable.org.apache.lucene.search.QuerymultiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements, SearchExecutionContext context) booleanneedsFallbackStorageForSyntheticSource(IndexVersion indexCreatedVersion) 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.org.apache.lucene.search.QuerytermQuery(Object value, SearchExecutionContext context) Generates a query that will only match documents that contain the given value.org.apache.lucene.search.QuerytermsQuery(Collection<?> values, SearchExecutionContext context) Build a constant-scoring query that matches all values.typeName()Returns the name of this type, as would be specified in mapping propertiesbooleanvalueFetcher(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.TextFamilyFieldType
isSyntheticSourceEnabled, isWithinMultiField, syntheticSourceFallbackFieldNameMethods inherited from class org.elasticsearch.index.mapper.StringFieldType
fuzzyQuery, normalizedWildcardQuery, normalizeWildcardPattern, rangeQuery, regexpQuery, wildcardQuery, wildcardQueryMethods inherited from class org.elasticsearch.index.mapper.TermBasedFieldType
getTextSearchInfo, indexedValueForSearch, mayExistInIndex, termQueryCaseInsensitiveMethods 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, failIfNoDocValues, failIfNotIndexed, failIfNotIndexedNorDocValuesFallback, familyTypeName, fieldHasValue, fuzzyQuery, getDefaultHighlighter, getMetricType, getTerms, hasDocValues, hasScriptValues, indexType, isDimension, isFieldWithinQuery, isStored, isVectorEmbedding, meta, name, pointReaderIfPossible, prefixQuery, supportsBlockLoaderConfig, validateMatchedRoutingPath, valueForDisplay, wildcardLikeQuery, wildcardQuery
-
Constructor Details
-
TextFieldType
public TextFieldType(String name, boolean indexed, boolean stored, boolean hasDocValues, TextSearchInfo tsi, boolean isSyntheticSource, boolean isWithinMultiField, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate, Map<String, String> meta, boolean eagerGlobalOrdinals, boolean indexPhrases, IndexVersion indexCreatedVersion, boolean usesBinaryDocValuesForFallbackFields, boolean usesBinaryDocValues) -
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
-
TextFieldType
-
TextFieldType
public TextFieldType(String name, boolean isSyntheticSource, boolean isWithinMultiField, KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate)
-
-
Method Details
-
fielddata
public boolean fielddata() -
usesBinaryDocValues
public boolean usesBinaryDocValues() -
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
-
isSearchable
public boolean isSearchable()Description copied from class:MappedFieldTypeReturns true if the field is searchable.- Overrides:
isSearchablein classMappedFieldType
-
termQuery
Description copied from class:MappedFieldTypeGenerates a query that will only match documents that contain the given value. The default implementation returns aTermQueryover the value bytes- Overrides:
termQueryin classTermBasedFieldType
-
termsQuery
public org.apache.lucene.search.Query termsQuery(Collection<?> values, SearchExecutionContext context) Description copied from class:MappedFieldTypeBuild a constant-scoring query that matches all values. The default implementation uses aConstantScoreQueryaround aBooleanQuerywhoseBooleanClause.Occur.SHOULDclauses are generated withMappedFieldType.termQuery(java.lang.Object, org.elasticsearch.index.query.SearchExecutionContext).- Overrides:
termsQueryin classTermBasedFieldType
-
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:TextFamilyFieldTypeCreate anIntervalsSourcefor the given term.- Overrides:
termIntervalsin classTextFamilyFieldType
-
prefixIntervals
public org.apache.lucene.queries.intervals.IntervalsSource prefixIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context) Description copied from class:TextFamilyFieldTypeCreate anIntervalsSourcefor the given prefix.- Overrides:
prefixIntervalsin classTextFamilyFieldType
-
fuzzyIntervals
public org.apache.lucene.queries.intervals.IntervalsSource fuzzyIntervals(String term, int maxDistance, int prefixLength, boolean transpositions, SearchExecutionContext context) Description copied from class:TextFamilyFieldTypeCreate a fuzzyIntervalsSourcefor the given term.- Overrides:
fuzzyIntervalsin classTextFamilyFieldType
-
wildcardIntervals
public org.apache.lucene.queries.intervals.IntervalsSource wildcardIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context) Description copied from class:TextFamilyFieldTypeCreate a wildcardIntervalsSourcefor the given pattern.- Overrides:
wildcardIntervalsin classTextFamilyFieldType
-
regexpIntervals
public org.apache.lucene.queries.intervals.IntervalsSource regexpIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context) Description copied from class:TextFamilyFieldTypeCreate a regexpIntervalsSourcefor the given pattern.- Overrides:
regexpIntervalsin classTextFamilyFieldType
-
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:TextFamilyFieldTypeCreate a rangeIntervalsSourcefor the given ranges- Overrides:
rangeIntervalsin classTextFamilyFieldType
-
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. isSearchable must be true) -
canUseSyntheticSourceDelegateForSyntheticSource
Returns whether this field can use its delegate keyword field for synthetic source. -
canUseSyntheticSourceDelegateForQueryingEquality
Returns true if the delegate sub-field can be used for querying only (ie. isSearchable must be true) -
needsFallbackStorageForSyntheticSource
-
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
-
syntheticSourceDelegate
-