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()protectedKeywordFieldType(KeywordFieldMapper.KeywordFieldType ref)
-
Method Summary
Modifier and Type Method Description voidcheckCompatibility(MappedFieldType otherFT, java.util.List<java.lang.String> conflicts)Checks for any conflicts between this field type and other.KeywordFieldMapper.KeywordFieldTypeclone()booleanequals(java.lang.Object o)org.apache.lucene.search.QueryexistsQuery(QueryShardContext context)IndexFieldData.BuilderfielddataBuilder(java.lang.String fullyQualifiedIndexName)Return a fielddata builder for this fieldinthashCode()protected org.apache.lucene.util.BytesRefindexedValueForSearch(java.lang.Object value)Returns the indexed value used to construct search "values".NamedAnalyzernormalizer()voidsetNormalizer(NamedAnalyzer normalizer)voidsetSplitQueriesOnWhitespace(boolean splitQueriesOnWhitespace)booleansplitQueriesOnWhitespace()org.apache.lucene.search.QuerytermQuery(java.lang.Object value, QueryShardContext context)Generates a query that will only match documents that contain the given value.java.lang.StringtypeName()Returns the name of this type, as would be specified in mapping propertiesjava.lang.ObjectvalueForDisplay(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.SimpleMappedFieldType
rangeQuery
-
Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
boost, docValueFormat, eagerGlobalOrdinals, extractTerm, failIfNoDocValues, failIfNotIndexed, hasDocValues, indexAnalyzer, intervals, isAggregatable, isFieldWithinQuery, isSearchable, multiPhraseQuery, name, nullValue, nullValueAsString, phrasePrefixQuery, phraseQuery, searchAnalyzer, searchQuoteAnalyzer, setBoost, setEagerGlobalOrdinals, setHasDocValues, setIndexAnalyzer, 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 Detail
-
KeywordFieldType
public KeywordFieldType()
-
KeywordFieldType
protected KeywordFieldType(KeywordFieldMapper.KeywordFieldType ref)
-
-
Method Detail
-
clone
public KeywordFieldMapper.KeywordFieldType clone()
- Specified by:
clonein classMappedFieldType
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classMappedFieldType
-
checkCompatibility
public void checkCompatibility(MappedFieldType otherFT, java.util.List<java.lang.String> conflicts)
Description copied from class:MappedFieldTypeChecks 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:
checkCompatibilityin classMappedFieldType
-
hashCode
public int hashCode()
- Overrides:
hashCodein classMappedFieldType
-
typeName
public java.lang.String typeName()
Description copied from class:MappedFieldTypeReturns the name of this type, as would be specified in mapping properties- Specified by:
typeNamein classMappedFieldType
-
normalizer
public NamedAnalyzer normalizer()
-
setNormalizer
public void setNormalizer(NamedAnalyzer normalizer)
-
splitQueriesOnWhitespace
public boolean splitQueriesOnWhitespace()
-
setSplitQueriesOnWhitespace
public void setSplitQueriesOnWhitespace(boolean splitQueriesOnWhitespace)
-
existsQuery
public org.apache.lucene.search.Query existsQuery(QueryShardContext context)
- Specified by:
existsQueryin classMappedFieldType
-
fielddataBuilder
public IndexFieldData.Builder fielddataBuilder(java.lang.String fullyQualifiedIndexName)
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 for
-
valueForDisplay
public java.lang.Object valueForDisplay(java.lang.Object value)
Description copied from class:MappedFieldTypeGiven 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:
valueForDisplayin 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
public org.apache.lucene.search.Query termQuery(java.lang.Object value, QueryShardContext context)Description copied from class:MappedFieldTypeGenerates a query that will only match documents that contain the given value. The default implementation returns aTermQueryover the value bytes, boosted byMappedFieldType.boost().- Specified by:
termQueryin classMappedFieldType
-
-