java.lang.Object
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.SimpleMappedFieldType
org.elasticsearch.index.mapper.TermBasedFieldType
- Direct Known Subclasses:
BooleanFieldMapper.BooleanFieldType,CompletionFieldMapper.CompletionFieldType,FieldNamesFieldMapper.FieldNamesFieldType,IdFieldMapper.AbstractIdFieldType,StringFieldType
Base
MappedFieldType implementation for a field that is indexed
with the inverted index.-
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
ConstructorsConstructorDescriptionTermBasedFieldType(String name, boolean isIndexed, boolean isStored, boolean hasDocValues, TextSearchInfo textSearchInfo, Map<String, String> meta) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.util.BytesRefindexedValueForSearch(Object value) Returns the indexed value used to construct search "values".booleanmayExistInIndex(SearchExecutionContext context) 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.QuerytermQueryCaseInsensitive(Object value, SearchExecutionContext context) org.apache.lucene.search.QuerytermsQuery(Collection<?> values, SearchExecutionContext context) Build a constant-scoring query that matches all values.Methods inherited from class org.elasticsearch.index.mapper.SimpleMappedFieldType
rangeQuery, rangeQueryMethods inherited from class org.elasticsearch.index.mapper.MappedFieldType
automatonQuery, blockLoader, checkNoFormat, checkNoTimeZone, collapseType, dimensions, distanceFeatureQuery, docValueFormat, eagerGlobalOrdinals, existsQuery, extractTerm, failIfNoDocValues, failIfNotIndexed, failIfNotIndexedNorDocValuesFallback, familyTypeName, fielddataBuilder, fieldHasValue, fuzzyIntervals, fuzzyQuery, fuzzyQuery, getDefaultHighlighter, getMetricType, getTerms, getTextSearchInfo, hasDocValues, hasScriptValues, isAggregatable, isDimension, isFieldWithinQuery, isIndexed, isSearchable, isStored, isVectorEmbedding, meta, multiPhraseQuery, name, normalizedWildcardQuery, phrasePrefixQuery, phraseQuery, pointReaderIfPossible, prefixIntervals, prefixQuery, prefixQuery, rangeIntervals, regexpIntervals, regexpQuery, spanPrefixQuery, termIntervals, typeName, validateMatchedRoutingPath, valueFetcher, valueForDisplay, wildcardIntervals, wildcardLikeQuery, wildcardQuery, wildcardQuery
-
Constructor Details
-
TermBasedFieldType
public TermBasedFieldType(String name, boolean isIndexed, boolean isStored, boolean hasDocValues, TextSearchInfo textSearchInfo, Map<String, String> meta)
-
-
Method Details
-
indexedValueForSearch
Returns the indexed value used to construct search "values". This method is used for the default implementations of most query factory methods such astermQuery(java.lang.Object, org.elasticsearch.index.query.SearchExecutionContext). -
termQueryCaseInsensitive
public org.apache.lucene.search.Query termQueryCaseInsensitive(Object value, SearchExecutionContext context) - Overrides:
termQueryCaseInsensitivein classMappedFieldType
-
mayExistInIndex
- Overrides:
mayExistInIndexin classMappedFieldType- Returns:
- if the field may have values in the underlying index
Note that this should only return
falseif it is not possible for it to match on a term query. - See Also:
-
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- Specified by:
termQueryin classMappedFieldType
-
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 classMappedFieldType
-