Package org.elasticsearch.index.mapper
Class TextFieldMapper.TextFieldType
java.lang.Object
org.apache.lucene.document.FieldType
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.SimpleMappedFieldType
org.elasticsearch.index.mapper.StringFieldType
org.elasticsearch.index.mapper.TextFieldMapper.TextFieldType
- All Implemented Interfaces:
org.apache.lucene.index.IndexableFieldType
- Enclosing class:
- TextFieldMapper
public static class TextFieldMapper.TextFieldType extends StringFieldType
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.Relation
-
Constructor Summary
Constructors Modifier Constructor Description TextFieldType()
protected
TextFieldType(TextFieldMapper.TextFieldType ref)
-
Method Summary
Modifier and Type Method Description void
checkCompatibility(MappedFieldType other, java.util.List<java.lang.String> conflicts)
Checks for any conflicts between this field type and other.TextFieldMapper.TextFieldType
clone()
boolean
equals(java.lang.Object o)
org.apache.lucene.search.Query
existsQuery(QueryShardContext context)
boolean
fielddata()
IndexFieldData.Builder
fielddataBuilder(java.lang.String fullyQualifiedIndexName)
Return a fielddata builder for this fielddouble
fielddataMaxFrequency()
double
fielddataMinFrequency()
int
fielddataMinSegmentSize()
org.elasticsearch.index.mapper.TextFieldMapper.PrefixFieldType
getPrefixFieldType()
ValuesSourceType
getValuesSourceType()
Returns theValuesSourceType
which supports this field type.static boolean
hasGaps(org.apache.lucene.analysis.TokenStream stream)
int
hashCode()
protected org.apache.lucene.util.BytesRef
indexedValueForSearch(java.lang.Object value)
Returns the indexed value used to construct search "values".org.apache.lucene.queries.intervals.IntervalsSource
intervals(java.lang.String text, int maxGaps, boolean ordered, NamedAnalyzer analyzer, boolean prefix)
Create anIntervalsSource
to be used for proximity queriesorg.apache.lucene.search.Query
multiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements)
org.apache.lucene.search.Query
phrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions)
org.apache.lucene.search.Query
phraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePosIncrements)
org.apache.lucene.search.Query
prefixQuery(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, QueryShardContext context)
void
setFielddata(boolean fielddata)
void
setFielddataMaxFrequency(double fielddataMaxFrequency)
void
setFielddataMinFrequency(double fielddataMinFrequency)
void
setFielddataMinSegmentSize(int fielddataMinSegmentSize)
org.apache.lucene.search.spans.SpanQuery
spanPrefixQuery(java.lang.String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, QueryShardContext context)
org.apache.lucene.search.Query
termQuery(java.lang.Object value, QueryShardContext context)
Generates a query that will only match documents that contain the given value.java.lang.String
typeName()
Returns the name of this type, as would be specified in mapping propertiesMethods inherited from class org.elasticsearch.index.mapper.StringFieldType
fuzzyQuery, normalizeWildcardPattern, rangeQuery, regexpQuery, termsQuery, wildcardQuery
Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
boost, docValueFormat, eagerGlobalOrdinals, extractTerm, failIfNoDocValues, failIfNotIndexed, hasDocValues, indexAnalyzer, isAggregatable, isFieldWithinQuery, isSearchable, meta, name, nullValue, nullValueAsString, searchAnalyzer, searchQuoteAnalyzer, setBoost, setEagerGlobalOrdinals, setHasDocValues, setIndexAnalyzer, setMeta, setName, setNullValue, setSearchAnalyzer, setSearchQuoteAnalyzer, setSimilarity, similarity, valueForDisplay
Methods inherited from class org.apache.lucene.document.FieldType
checkIfFrozen, docValuesType, freeze, getAttributes, indexOptions, omitNorms, pointDimensionCount, pointIndexDimensionCount, pointNumBytes, putAttribute, setDimensions, setDimensions, setDocValuesType, setIndexOptions, setOmitNorms, setStored, setStoreTermVectorOffsets, setStoreTermVectorPayloads, setStoreTermVectorPositions, setStoreTermVectors, setTokenized, stored, storeTermVectorOffsets, storeTermVectorPayloads, storeTermVectorPositions, storeTermVectors, tokenized, toString
-
Constructor Details
-
TextFieldType
public TextFieldType() -
TextFieldType
-
-
Method Details
-
clone
- Specified by:
clone
in classMappedFieldType
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classMappedFieldType
-
hashCode
public int hashCode()- Overrides:
hashCode
in classMappedFieldType
-
fielddata
public boolean fielddata() -
setFielddata
public void setFielddata(boolean fielddata) -
fielddataMinFrequency
public double fielddataMinFrequency() -
setFielddataMinFrequency
public void setFielddataMinFrequency(double fielddataMinFrequency) -
fielddataMaxFrequency
public double fielddataMaxFrequency() -
setFielddataMaxFrequency
public void setFielddataMaxFrequency(double fielddataMaxFrequency) -
fielddataMinSegmentSize
public int fielddataMinSegmentSize() -
setFielddataMinSegmentSize
public void setFielddataMinSegmentSize(int fielddataMinSegmentSize) -
getPrefixFieldType
public org.elasticsearch.index.mapper.TextFieldMapper.PrefixFieldType getPrefixFieldType() -
typeName
public java.lang.String typeName()Description copied from class:MappedFieldType
Returns the name of this type, as would be specified in mapping properties- Specified by:
typeName
in classMappedFieldType
-
prefixQuery
public org.apache.lucene.search.Query prefixQuery(java.lang.String value, org.apache.lucene.search.MultiTermQuery.RewriteMethod method, QueryShardContext context)- Overrides:
prefixQuery
in classStringFieldType
-
spanPrefixQuery
public org.apache.lucene.search.spans.SpanQuery spanPrefixQuery(java.lang.String value, org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod method, QueryShardContext context)- Overrides:
spanPrefixQuery
in classMappedFieldType
-
existsQuery
- Specified by:
existsQuery
in classMappedFieldType
-
intervals
public org.apache.lucene.queries.intervals.IntervalsSource intervals(java.lang.String text, int maxGaps, boolean ordered, NamedAnalyzer analyzer, boolean prefix) throws java.io.IOExceptionDescription copied from class:MappedFieldType
Create anIntervalsSource
to be used for proximity queries- Overrides:
intervals
in classMappedFieldType
- Throws:
java.io.IOException
-
phraseQuery
public org.apache.lucene.search.Query phraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePosIncrements) throws java.io.IOException- Overrides:
phraseQuery
in classMappedFieldType
- Throws:
java.io.IOException
-
multiPhraseQuery
public org.apache.lucene.search.Query multiPhraseQuery(org.apache.lucene.analysis.TokenStream stream, int slop, boolean enablePositionIncrements) throws java.io.IOException- Overrides:
multiPhraseQuery
in classMappedFieldType
- Throws:
java.io.IOException
-
phrasePrefixQuery
public org.apache.lucene.search.Query phrasePrefixQuery(org.apache.lucene.analysis.TokenStream stream, int slop, int maxExpansions) throws java.io.IOException- Overrides:
phrasePrefixQuery
in classMappedFieldType
- Throws:
java.io.IOException
-
hasGaps
public static boolean hasGaps(org.apache.lucene.analysis.TokenStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
fielddataBuilder
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 for
-
getValuesSourceType
Description copied from class:MappedFieldType
Returns theValuesSourceType
which supports this field type. This is tightly coupled to field data and aggregations support, so any implementation that returns a value fromMappedFieldType.fielddataBuilder(java.lang.String)
should also return a value from here.- Overrides:
getValuesSourceType
in classMappedFieldType
- Returns:
- The appropriate
ValuesSourceType
for this field type.
-
checkCompatibility
Description copied from class:MappedFieldType
Checks for any conflicts between this field type and other. If strict is true, all properties must be equal. Otherwise, only properties which must never change in an index are checked.- Overrides:
checkCompatibility
in classMappedFieldType
-
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 asMappedFieldType.termQuery(java.lang.Object, org.elasticsearch.index.query.QueryShardContext)
. -
termQuery
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
-