java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
org.elasticsearch.index.mapper.MetadataFieldMapper
- All Implemented Interfaces:
Iterable<Mapper>,ToXContent,ToXContentFragment
- Direct Known Subclasses:
DataStreamTimestampFieldMapper,DocCountFieldMapper,FieldNamesFieldMapper,IdFieldMapper,IgnoredFieldMapper,IndexFieldMapper,LegacyTypeFieldMapper,NestedPathFieldMapper,RoutingFieldMapper,SeqNoFieldMapper,SourceFieldMapper,TimeSeriesIdFieldMapper,TimeSeriesRoutingHashFieldMapper,VersionFieldMapper
A mapper for a builtin field containing metadata about a document.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classA type parser for an unconfigurable metadata field.static interfaceNested classes/interfaces inherited from class org.elasticsearch.index.mapper.FieldMapper
FieldMapper.Conflicts, FieldMapper.CopyTo, FieldMapper.DimensionBuilder, FieldMapper.MergeValidator<T>, FieldMapper.MultiFields, FieldMapper.Parameter<T>, FieldMapper.Serializer<T>, FieldMapper.SerializerCheck<T>Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
Fields inherited from class org.elasticsearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, deprecationLogger, hasScript, IGNORE_MALFORMED_SETTING, mappedFieldType, multiFields, onScriptErrorFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns aFieldMapper.Builderto be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);protected voidparseCreateField(DocumentParserContext context) Parse the field value and populate the fields onDocumentParserContext.doc().voidpostParse(DocumentParserContext context) Called afterFieldMapper.parse(DocumentParserContext)on theRootObjectMapper.voidpreParse(DocumentParserContext context) Called beforeFieldMapper.parse(DocumentParserContext)on theRootObjectMapper.abstract SourceLoader.SyntheticFieldLoaderCreate aSourceLoader.SyntheticFieldLoaderto populate synthetic source.final XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params) static FieldMapper.Parameter<Explicit<Boolean>>updateableBoolParam(String name, Function<FieldMapper, Explicit<Boolean>> initializer, boolean defaultValue) Declares an updateable boolean parameter for a metadata field We need to distinguish between explicit configuration and default value for metadata fields, because mapping updates will carry over the previous metadata values if a metadata field is not explicitly declared in the update.Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
checkIncomingMergeType, contentType, copyTo, doValidate, doXContentBody, executeScript, fieldType, getTotalFieldsCount, hasScript, ignoreMalformed, indexAnalyzers, indexScriptValues, iterator, merge, multiFields, multiFieldsIterator, name, notInMultiFields, parse, parsesArrayValue, sourcePathUsedBy, supportsParsingObject, typeName, validateMethods inherited from class org.elasticsearch.index.mapper.Mapper
freezeAndDeduplicateFieldType, internFieldName, simpleName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
MetadataFieldMapper
-
-
Method Details
-
updateableBoolParam
public static FieldMapper.Parameter<Explicit<Boolean>> updateableBoolParam(String name, Function<FieldMapper, Explicit<Boolean>> initializer, boolean defaultValue) Declares an updateable boolean parameter for a metadata field We need to distinguish between explicit configuration and default value for metadata fields, because mapping updates will carry over the previous metadata values if a metadata field is not explicitly declared in the update. A standard boolean parameter explicitly configured with a default value will not be serialized (as we do not serialize default parameters for mapping updates), and as such will be ignored by the update merge. Instead, we use anExplicitobject that will serialize its value if it has been configured, no matter what the value is. -
getMergeBuilder
Description copied from class:FieldMapperReturns aFieldMapper.Builderto be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);- Specified by:
getMergeBuilderin classFieldMapper
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Overrides:
toXContentin classFieldMapper- Throws:
IOException
-
parseCreateField
Description copied from class:FieldMapperParse the field value and populate the fields onDocumentParserContext.doc(). Implementations of this method should ensure that on failing to parse parser.currentToken() must be the current failing token- Specified by:
parseCreateFieldin classFieldMapper- Throws:
IOException
-
preParse
Called beforeFieldMapper.parse(DocumentParserContext)on theRootObjectMapper.- Throws:
IOException
-
postParse
Called afterFieldMapper.parse(DocumentParserContext)on theRootObjectMapper.- Throws:
IOException
-
syntheticFieldLoader
Description copied from class:MapperCreate aSourceLoader.SyntheticFieldLoaderto populate synthetic source.- Overrides:
syntheticFieldLoaderin classMapper
-