Package org.elasticsearch.index.mapper
Class TermBasedFieldType
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
,StringFieldType
public abstract class TermBasedFieldType extends SimpleMappedFieldType
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.CollapseType, MappedFieldType.Relation
-
Constructor Summary
Constructors Constructor Description TermBasedFieldType(java.lang.String name, boolean isSearchable, boolean isStored, boolean hasDocValues, TextSearchInfo textSearchInfo, java.util.Map<java.lang.String,java.lang.String> meta)
-
Method Summary
Modifier and Type Method Description protected org.apache.lucene.util.BytesRef
indexedValueForSearch(java.lang.Object value)
Returns the indexed value used to construct search "values".org.apache.lucene.search.Query
termQuery(java.lang.Object value, SearchExecutionContext context)
Generates a query that will only match documents that contain the given value.org.apache.lucene.search.Query
termQueryCaseInsensitive(java.lang.Object value, SearchExecutionContext context)
org.apache.lucene.search.Query
termsQuery(java.util.Collection<?> values, SearchExecutionContext context)
Build a constant-scoring query that matches all values.Methods inherited from class org.elasticsearch.index.mapper.SimpleMappedFieldType
rangeQuery, rangeQuery
Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
boost, collapseType, distanceFeatureQuery, docValueFormat, eagerGlobalOrdinals, existsQuery, extractTerm, failIfNoDocValues, failIfNotIndexed, familyTypeName, fielddataBuilder, fuzzyQuery, getTextSearchInfo, hasDocValues, intervals, isAggregatable, isFieldWithinQuery, isSearchable, isStored, meta, multiPhraseQuery, name, phrasePrefixQuery, phraseQuery, pointReaderIfPossible, prefixQuery, prefixQuery, regexpQuery, setBoost, setEagerGlobalOrdinals, spanPrefixQuery, typeName, valueFetcher, valueForDisplay, wildcardQuery, wildcardQuery
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TermBasedFieldType
public TermBasedFieldType(java.lang.String name, boolean isSearchable, boolean isStored, boolean hasDocValues, TextSearchInfo textSearchInfo, java.util.Map<java.lang.String,java.lang.String> meta)
-
-
Method Details
-
indexedValueForSearch
protected org.apache.lucene.util.BytesRef indexedValueForSearch(java.lang.Object value)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(java.lang.Object value, SearchExecutionContext context)- Overrides:
termQueryCaseInsensitive
in classMappedFieldType
-
termQuery
public org.apache.lucene.search.Query termQuery(java.lang.Object value, SearchExecutionContext context)Description copied from class:MappedFieldType
Generates a query that will only match documents that contain the given value. The default implementation returns aTermQuery
over the value bytes, boosted byMappedFieldType.boost()
.- Specified by:
termQuery
in classMappedFieldType
-
termsQuery
public org.apache.lucene.search.Query termsQuery(java.util.Collection<?> values, SearchExecutionContext context)Description copied from class:MappedFieldType
Build a constant-scoring query that matches all values. The default implementation uses aConstantScoreQuery
around aBooleanQuery
whoseBooleanClause.Occur.SHOULD
clauses are generated withMappedFieldType.termQuery(java.lang.Object, org.elasticsearch.index.query.SearchExecutionContext)
.- Overrides:
termsQuery
in classMappedFieldType
-