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
- Enclosing class:
- TextFieldMapper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.CollapseType, MappedFieldType.Relation
-
Constructor Summary
ConstructorDescriptionTextFieldType(String name)
TextFieldType(String name, boolean indexed, boolean stored, Map<String,String> meta)
TextFieldType(String name, boolean indexed, boolean stored, TextSearchInfo tsi, Map<String,String> meta)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
fielddataBuilder(String fullyQualifiedIndexName, Supplier<SearchLookup> searchLookup)
Return a fielddata builder for this fieldorg.apache.lucene.queries.intervals.IntervalsSource
fuzzyIntervals(String term, int maxDistance, int prefixLength, boolean transpositions, SearchExecutionContext context)
Create a fuzzyIntervalsSource
for the given term.org.elasticsearch.index.mapper.TextFieldMapper.PrefixFieldType
static boolean
hasGaps(org.apache.lucene.analysis.TokenStream stream)
org.apache.lucene.search.Query
multiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements, SearchExecutionContext context)
org.apache.lucene.search.Query
phrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions, SearchExecutionContext context)
org.apache.lucene.search.Query
phraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePosIncrements, SearchExecutionContext context)
org.apache.lucene.queries.intervals.IntervalsSource
prefixIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context)
Create anIntervalsSource
for the given prefix.org.apache.lucene.search.Query
prefixQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)
void
setFielddata(boolean fielddata)
void
setFielddata(boolean fielddata, org.elasticsearch.index.mapper.TextFieldMapper.FielddataFrequencyFilter filter)
org.apache.lucene.search.spans.SpanQuery
spanPrefixQuery(String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context)
org.apache.lucene.queries.intervals.IntervalsSource
termIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context)
Create anIntervalsSource
for 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.IntervalsSource
wildcardIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context)
Create a wildcardIntervalsSource
for the given pattern.Methods inherited from class org.elasticsearch.index.mapper.StringFieldType
fuzzyQuery, normalizedWildcardQuery, normalizeWildcardPattern, rangeQuery, regexpQuery, wildcardQuery, wildcardQuery
Methods inherited from class org.elasticsearch.index.mapper.TermBasedFieldType
indexedValueForSearch, termQuery, termQueryCaseInsensitive, termsQuery
Methods inherited from class org.elasticsearch.index.mapper.SimpleMappedFieldType
rangeQuery
Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
boost, collapseType, distanceFeatureQuery, docValueFormat, existsQuery, extractTerm, failIfNoDocValues, failIfNotIndexed, familyTypeName, getTerms, getTextSearchInfo, hasDocValues, isAggregatable, isFieldWithinQuery, isSearchable, isStored, meta, name, pointReaderIfPossible, prefixQuery, setBoost, valueForDisplay, wildcardQuery
-
Constructor Details
-
TextFieldType
public TextFieldType(String name, boolean indexed, boolean stored, TextSearchInfo tsi, Map<String,String> meta) -
TextFieldType
-
TextFieldType
-
-
Method Details
-
fielddata
public boolean fielddata() -
eagerGlobalOrdinals
public boolean eagerGlobalOrdinals()- Overrides:
eagerGlobalOrdinals
in 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:MappedFieldType
Returns the name of this type, as would be specified in mapping properties- Specified by:
typeName
in classMappedFieldType
-
valueFetcher
Description copied from class:MappedFieldType
Create 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 throw
UnsupportedOperationException
since this could cause a search retrieving multiple fields (like "fields": ["*"]) to fail.- Specified by:
valueFetcher
in classMappedFieldType
-
prefixQuery
public org.apache.lucene.search.Query prefixQuery(String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, boolean caseInsensitive, SearchExecutionContext context)- Overrides:
prefixQuery
in classStringFieldType
-
spanPrefixQuery
public org.apache.lucene.search.spans.SpanQuery spanPrefixQuery(String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, SearchExecutionContext context)- Overrides:
spanPrefixQuery
in classMappedFieldType
-
termIntervals
public org.apache.lucene.queries.intervals.IntervalsSource termIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context)Description copied from class:MappedFieldType
Create anIntervalsSource
for the given term.- Overrides:
termIntervals
in classMappedFieldType
-
prefixIntervals
public org.apache.lucene.queries.intervals.IntervalsSource prefixIntervals(org.apache.lucene.util.BytesRef term, SearchExecutionContext context)Description copied from class:MappedFieldType
Create anIntervalsSource
for the given prefix.- Overrides:
prefixIntervals
in classMappedFieldType
-
fuzzyIntervals
public org.apache.lucene.queries.intervals.IntervalsSource fuzzyIntervals(String term, int maxDistance, int prefixLength, boolean transpositions, SearchExecutionContext context)Description copied from class:MappedFieldType
Create a fuzzyIntervalsSource
for the given term.- Overrides:
fuzzyIntervals
in classMappedFieldType
-
wildcardIntervals
public org.apache.lucene.queries.intervals.IntervalsSource wildcardIntervals(org.apache.lucene.util.BytesRef pattern, SearchExecutionContext context)Description copied from class:MappedFieldType
Create a wildcardIntervalsSource
for the given pattern.- Overrides:
wildcardIntervals
in classMappedFieldType
-
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 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:
multiPhraseQuery
in 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:
phrasePrefixQuery
in classMappedFieldType
- Throws:
IOException
-
hasGaps
- Throws:
IOException
-
fielddataBuilder
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier<SearchLookup> searchLookup)Description copied from class:MappedFieldType
Return a fielddata builder for this field- Overrides:
fielddataBuilder
in classMappedFieldType
- Parameters:
fullyQualifiedIndexName
- the name of the index this field-data is build forsearchLookup
- aSearchLookup
supplier to allow for accessing other fields values in the context of runtime fields
-