java.lang.Object
org.elasticsearch.index.mapper.MappingBuilder
Mutable builder for a
Mapping. Holds a RootObjectMapper.Builder and metadata field builders,
allowing merge operations to happen at the builder level before building the final immutable Mapping.-
Constructor Summary
ConstructorsConstructorDescriptionMappingBuilder(RootObjectMapper.Builder rootBuilder, Map<String, MetadataFieldMapper.Builder> metadataBuilders, Map<String, Object> meta) -
Method Summary
Modifier and TypeMethodDescriptionbuild(MapperService.MergeReason reason) Builds the final immutableMappingfrom the current builder state.voidmerge(MappingBuilder incoming, MapperService.MergeReason reason, long newFieldsBudget) Merges anotherMappingBuilderinto this one, mutating this builder in place.metadataBuilder(String name)
-
Constructor Details
-
MappingBuilder
public MappingBuilder(RootObjectMapper.Builder rootBuilder, Map<String, MetadataFieldMapper.Builder> metadataBuilders, @Nullable Map<String, Object> meta)
-
-
Method Details
-
rootBuilder
-
metadataBuilder
-
merge
Merges anotherMappingBuilderinto this one, mutating this builder in place.- Parameters:
incoming- the incoming mapping builder to mergereason- the reason for the mergenewFieldsBudget- how many new fields may be added during the merge
-
build
Builds the final immutableMappingfrom the current builder state.- Parameters:
reason- the merge reason, used to configure theMapperBuilderContextfor building- Returns:
- the built
Mapping
-