public class TokenCountFieldMapper extends IntegerFieldMapper
FieldMapper that takes a string and writes a count of the tokens in that string
to the index. In most ways the mapper acts just like an IntegerFieldMapper.| Modifier and Type | Class and Description |
|---|---|
static class |
TokenCountFieldMapper.Builder |
static class |
TokenCountFieldMapper.Defaults |
static class |
TokenCountFieldMapper.TypeParser |
IntegerFieldMapper.CustomIntegerNumericField, IntegerFieldMapper.IntegerFieldTypeNumberFieldMapper.CustomLongNumericDocValuesField, NumberFieldMapper.CustomNumericDocValuesField, NumberFieldMapper.CustomNumericField, NumberFieldMapper.NumberFieldTypeFieldMapper.CopyTo, FieldMapper.MultiFieldsMapper.BuilderContextToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_TYPE |
coerce, ignoreMalformed, includeInAll, useSortedNumericDocValuescopyTo, defaultFieldType, fieldType, indexCreatedBefore2x, multiFieldsEMPTY_PARAMS| Modifier | Constructor and Description |
|---|---|
protected |
TokenCountFieldMapper(String simpleName,
MappedFieldType fieldType,
MappedFieldType defaultFieldType,
Explicit<Boolean> ignoreMalformed,
Explicit<Boolean> coerce,
Settings indexSettings,
NamedAnalyzer analyzer,
FieldMapper.MultiFields multiFields,
FieldMapper.CopyTo copyTo) |
| Modifier and Type | Method and Description |
|---|---|
String |
analyzer()
Name of analyzer.
|
protected String |
contentType() |
protected void |
doMerge(Mapper mergeWith,
boolean updateAllTypes)
Merge changes coming from
mergeWith in place. |
protected void |
doXContentBody(XContentBuilder builder,
boolean includeDefaults,
ToXContent.Params params) |
boolean |
isGenerated()
Fields might not be available before indexing, for example _all, token_count,...
|
protected void |
parseCreateField(ParseContext context,
List<org.apache.lucene.document.Field> fields)
Parse the field value and populate
fields. |
addIntegerFields, customBoost, fieldType, innerParseCreateFieldaddDocValue, clone, includeInAll, includeInAllIfNotSet, parseDoubleValue, parseLongValue, unsetIncludeInAllcopyTo, doXContentAnalyzers, doXContentDocValues, hasCustomFieldDataSettings, indexOptionToString, indexTokenizeOptionToString, iterator, merge, name, parse, termVectorOptionsToString, toXContent, updateFieldTypesimpleNamepublic static final String CONTENT_TYPE
protected TokenCountFieldMapper(String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Explicit<Boolean> ignoreMalformed, Explicit<Boolean> coerce, Settings indexSettings, NamedAnalyzer analyzer, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
protected void parseCreateField(ParseContext context, List<org.apache.lucene.document.Field> fields) throws IOException
FieldMapperfields.parseCreateField in class NumberFieldMapperIOExceptionpublic String analyzer()
protected String contentType()
contentType in class IntegerFieldMapperprotected void doMerge(Mapper mergeWith, boolean updateAllTypes)
FieldMappermergeWith in place.doMerge in class NumberFieldMapperupdateAllTypes - TODOprotected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws IOException
doXContentBody in class IntegerFieldMapperIOExceptionpublic boolean isGenerated()
FieldMapperisGenerated in class FieldMapperCopyright © 2009–2017. All rights reserved.