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.IntegerFieldType
NumberFieldMapper.CustomLongNumericDocValuesField, NumberFieldMapper.CustomNumericDocValuesField, NumberFieldMapper.CustomNumericField, NumberFieldMapper.NumberFieldType
FieldMapper.CopyTo, FieldMapper.MultiFields
Mapper.BuilderContext
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE |
coerce, ignoreMalformed, includeInAll, useSortedNumericDocValues
copyTo, defaultFieldType, fieldType, indexCreatedBefore2x, multiFields
EMPTY_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, innerParseCreateField
addDocValue, clone, includeInAll, includeInAllIfNotSet, parseDoubleValue, parseLongValue, unsetIncludeInAll
copyTo, doXContentAnalyzers, doXContentDocValues, hasCustomFieldDataSettings, indexOptionToString, indexTokenizeOptionToString, iterator, merge, name, parse, termVectorOptionsToString, toXContent, updateFieldType
simpleName
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public 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
FieldMapper
fields
.parseCreateField
in class NumberFieldMapper
IOException
public String analyzer()
protected String contentType()
contentType
in class IntegerFieldMapper
protected void doMerge(Mapper mergeWith, boolean updateAllTypes)
FieldMapper
mergeWith
in place.doMerge
in class NumberFieldMapper
updateAllTypes
- TODOprotected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws IOException
doXContentBody
in class IntegerFieldMapper
IOException
public boolean isGenerated()
FieldMapper
isGenerated
in class FieldMapper
Copyright © 2009–2016. All rights reserved.