Package org.elasticsearch.index.mapper
Class TokenCountFieldMapper
- java.lang.Object
-
- org.elasticsearch.index.mapper.Mapper
-
- org.elasticsearch.index.mapper.FieldMapper
-
- org.elasticsearch.index.mapper.TokenCountFieldMapper
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<Mapper>,ToXContent,ToXContentFragment
public class TokenCountFieldMapper extends FieldMapper
AFieldMapperthat takes a string and writes a count of the tokens in that string to the index. In most ways the mapper acts just like anNumberFieldMapper.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTokenCountFieldMapper.Builderstatic classTokenCountFieldMapper.Defaultsstatic classTokenCountFieldMapper.TypeParser-
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.FieldMapper
FieldMapper.CopyTo, FieldMapper.MultiFields
-
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContext
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTENT_TYPE-
Fields inherited from class org.elasticsearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, defaultFieldType, fieldType, IGNORE_MALFORMED_SETTING, indexCreatedVersion, multiFields
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTokenCountFieldMapper(java.lang.String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Settings indexSettings, NamedAnalyzer analyzer, boolean enablePositionIncrements, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
-
Method Summary
Modifier and Type Method Description java.lang.Stringanalyzer()Name of analyzer.protected java.lang.StringcontentType()protected voiddoMerge(Mapper mergeWith)protected voiddoXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params)booleanenablePositionIncrements()Indicates if position increments are counted.protected voidparseCreateField(ParseContext context, java.util.List<IndexableField> fields)-
Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
clone, copyTo, createFieldNamesField, doXContentAnalyzers, doXContentDocValues, fieldType, indexOptionToString, iterator, merge, name, parse, termVectorOptionsToString, toXContent, typeName, updateFieldType
-
Methods inherited from class org.elasticsearch.index.mapper.Mapper
simpleName
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TokenCountFieldMapper
protected TokenCountFieldMapper(java.lang.String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Settings indexSettings, NamedAnalyzer analyzer, boolean enablePositionIncrements, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
-
-
Method Detail
-
parseCreateField
protected void parseCreateField(ParseContext context, java.util.List<IndexableField> fields) throws java.io.IOException
- Specified by:
parseCreateFieldin classFieldMapper- Throws:
java.io.IOException
-
analyzer
public java.lang.String analyzer()
Name of analyzer.- Returns:
- name of analyzer
-
enablePositionIncrements
public boolean enablePositionIncrements()
Indicates if position increments are counted.- Returns:
trueif position increments are counted
-
contentType
protected java.lang.String contentType()
- Specified by:
contentTypein classFieldMapper
-
doMerge
protected void doMerge(Mapper mergeWith)
- Overrides:
doMergein classFieldMapper
-
doXContentBody
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws java.io.IOException
- Overrides:
doXContentBodyin classFieldMapper- Throws:
java.io.IOException
-
-