Package org.elasticsearch.index.mapper
Class KeywordFieldMapper.KeywordFieldType
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.KeywordFieldMapper.KeywordFieldType
- All Implemented Interfaces:
org.apache.lucene.index.IndexableFieldType
- Enclosing class:
- KeywordFieldMapper
public static final class KeywordFieldMapper.KeywordFieldType extends StringFieldType
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.Relation
-
Constructor Summary
Constructors Modifier Constructor Description KeywordFieldType()
protected
KeywordFieldType(KeywordFieldMapper.KeywordFieldType ref)
-
Method Summary
Modifier and Type Method Description void
checkCompatibility(MappedFieldType otherFT, java.util.List<java.lang.String> conflicts)
Checks for any conflicts between this field type and other.KeywordFieldMapper.KeywordFieldType
clone()
boolean
equals(java.lang.Object o)
org.apache.lucene.search.Query
existsQuery(QueryShardContext context)
IndexFieldData.Builder
fielddataBuilder(java.lang.String fullyQualifiedIndexName)
Return a fielddata builder for this fieldint
hashCode()
protected org.apache.lucene.util.BytesRef
indexedValueForSearch(java.lang.Object value)
Returns the indexed value used to construct search "values".void
setNormalizer(NamedAnalyzer normalizer)
void
setSplitQueriesOnWhitespace(boolean splitQueriesOnWhitespace)
boolean
splitQueriesOnWhitespace()
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 propertiesjava.lang.Object
valueForDisplay(java.lang.Object value)
Given a value that comes from the stored fields API, convert it to the expected type.Methods inherited from class org.elasticsearch.index.mapper.StringFieldType
fuzzyQuery, prefixQuery, rangeQuery, regexpQuery, termsQuery, wildcardQuery
Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
boost, docValueFormat, eagerGlobalOrdinals, extractTerm, failIfNoDocValues, failIfNotIndexed, hasDocValues, indexAnalyzer, intervals, isAggregatable, isFieldWithinQuery, isSearchable, meta, multiPhraseQuery, name, nullValue, nullValueAsString, phrasePrefixQuery, phraseQuery, searchAnalyzer, searchQuoteAnalyzer, setBoost, setEagerGlobalOrdinals, setHasDocValues, setIndexAnalyzer, setMeta, setName, setNullValue, setSearchAnalyzer, setSearchQuoteAnalyzer, setSimilarity, similarity, spanPrefixQuery
Methods inherited from class org.apache.lucene.document.FieldType
checkIfFrozen, docValuesType, freeze, getAttributes, indexOptions, omitNorms, pointDataDimensionCount, pointIndexDimensionCount, pointNumBytes, putAttribute, setDimensions, setDimensions, setDocValuesType, setIndexOptions, setOmitNorms, setStored, setStoreTermVectorOffsets, setStoreTermVectorPayloads, setStoreTermVectorPositions, setStoreTermVectors, setTokenized, stored, storeTermVectorOffsets, storeTermVectorPayloads, storeTermVectorPositions, storeTermVectors, tokenized, toString
-
Constructor Details
-
KeywordFieldType
public KeywordFieldType() -
KeywordFieldType
-
-
Method Details
-
clone
- Specified by:
clone
in classMappedFieldType
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classMappedFieldType
-
checkCompatibility
public void checkCompatibility(MappedFieldType otherFT, java.util.List<java.lang.String> conflicts)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
-
hashCode
public int hashCode()- Overrides:
hashCode
in classMappedFieldType
-
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
-
setNormalizer
-
splitQueriesOnWhitespace
public boolean splitQueriesOnWhitespace() -
setSplitQueriesOnWhitespace
public void setSplitQueriesOnWhitespace(boolean splitQueriesOnWhitespace) -
existsQuery
- Specified by:
existsQuery
in classMappedFieldType
-
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
-
valueForDisplay
public java.lang.Object valueForDisplay(java.lang.Object value)Description copied from class:MappedFieldType
Given a value that comes from the stored fields API, convert it to the expected type. For instance a date field would store dates as longs and format it back to a string in this method.- Overrides:
valueForDisplay
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
-