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
ConstructorsConstructorDescriptionTextFieldType(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 TypeMethodDescriptionbooleanbooleanfielddataBuilder(String fullyQualifiedIndexName, Supplier<SearchLookup> searchLookup)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)org.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)voidsetFielddata(boolean fielddata)voidsetFielddata(boolean fielddata, org.elasticsearch.index.mapper.TextFieldMapper.FielddataFrequencyFilter filter)org.apache.lucene.search.spans.SpanQueryspanPrefixQuery(String value, org.apache.lucene.search.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, termQuery, termQueryCaseInsensitive, termsQueryMethods inherited from class org.elasticsearch.index.mapper.SimpleMappedFieldType
rangeQueryMethods 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:
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 throw
UnsupportedOperationExceptionsince 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.search.spans.SpanQuery spanPrefixQuery(String value, org.apache.lucene.search.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
-
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
-
fielddataBuilder
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier<SearchLookup> searchLookup)Description copied from class:MappedFieldTypeReturn a fielddata builder for this field- Overrides:
fielddataBuilderin classMappedFieldType- Parameters:
fullyQualifiedIndexName- the name of the index this field-data is build forsearchLookup- aSearchLookupsupplier to allow for accessing other fields values in the context of runtime fields
-