Package org.elasticsearch.index.mapper
Class SeqNoFieldMapper
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
org.elasticsearch.index.mapper.MetadataFieldMapper
org.elasticsearch.index.mapper.SeqNoFieldMapper
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Iterable<Mapper>
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public class SeqNoFieldMapper extends MetadataFieldMapper
Mapper for the
_seq_no
field.
We expect to use the seq# for sorting, during collision checking and for
doing range searches. Therefore the _seq_no
field is stored both
as a numeric doc value and as numeric indexed field.
This mapper also manages the primary term field, which has no ES named
equivalent. The primary term is only used during collision after receiving
identical seq# values for two document copies. The primary term is stored as
a doc value field without being indexed, since it is only intended for use
as a key-value lookup.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SeqNoFieldMapper.Defaults
static class
SeqNoFieldMapper.SequenceIDFields
A sequence ID, which is made up of a sequence number (both the searchable and doc_value version of the field) and the primary term.static class
SeqNoFieldMapper.TypeParser
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MetadataFieldMapper
MetadataFieldMapper.Builder<T extends MetadataFieldMapper.Builder<T>>
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
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONTENT_TYPE
static java.lang.String
NAME
static java.lang.String
PRIMARY_TERM_NAME
static java.lang.String
TOMBSTONE_NAME
Fields inherited from class org.elasticsearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, fieldType, IGNORE_MALFORMED_SETTING, mappedFieldType, multiFields
-
Constructor Summary
Constructors Constructor Description SeqNoFieldMapper()
-
Method Summary
Modifier and Type Method Description protected java.lang.String
contentType()
void
parse(ParseContext context)
Parse the field value using the providedParseContext
.protected void
parseCreateField(ParseContext context)
Parse the field value and populate the fields onParseContext.doc()
.void
postParse(ParseContext context)
Called afterFieldMapper.parse(ParseContext)
on theRootObjectMapper
.void
preParse(ParseContext context)
Called beforeFieldMapper.parse(ParseContext)
on theRootObjectMapper
.org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
Methods inherited from class org.elasticsearch.index.mapper.MetadataFieldMapper
mergeOptions, validate
Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
clone, copyTo, createFieldNamesField, docValuesByDefault, doXContentAnalyzers, doXContentBody, fieldType, indexedByDefault, indexOptionToString, iterator, merge, name, parsesArrayValue, storedByDefault, termVectorOptionsToString, typeName
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE- See Also:
- Constant Field Values
-
PRIMARY_TERM_NAME
public static final java.lang.String PRIMARY_TERM_NAME- See Also:
- Constant Field Values
-
TOMBSTONE_NAME
public static final java.lang.String TOMBSTONE_NAME- See Also:
- Constant Field Values
-
-
Constructor Details
-
SeqNoFieldMapper
public SeqNoFieldMapper()
-
-
Method Details
-
preParse
Description copied from class:MetadataFieldMapper
Called beforeFieldMapper.parse(ParseContext)
on theRootObjectMapper
.- Specified by:
preParse
in classMetadataFieldMapper
- Throws:
java.io.IOException
-
parseCreateField
Description copied from class:FieldMapper
Parse the field value and populate the fields onParseContext.doc()
. Implementations of this method should ensure that on failing to parse parser.currentToken() must be the current failing token- Specified by:
parseCreateField
in classFieldMapper
- Throws:
java.io.IOException
-
parse
Description copied from class:FieldMapper
Parse the field value using the providedParseContext
.- Overrides:
parse
in classFieldMapper
- Throws:
java.io.IOException
-
postParse
Description copied from class:MetadataFieldMapper
Called afterFieldMapper.parse(ParseContext)
on theRootObjectMapper
.- Overrides:
postParse
in classMetadataFieldMapper
- Throws:
java.io.IOException
-
contentType
protected java.lang.String contentType()- Specified by:
contentType
in classFieldMapper
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Overrides:
toXContent
in classFieldMapper
- Throws:
java.io.IOException
-