Mapping: dynamic flag is explicitly returned even when not set
fixes #2789
This commit is contained in:
parent
c25eb7defe
commit
111a13222e
|
@ -532,7 +532,11 @@ public class ObjectMapper implements Mapper, AllFieldMapper.IncludeInAll {
|
|||
context.path().remove();
|
||||
Mapper.Builder builder = context.root().findTemplateBuilder(context, currentFieldName, "object");
|
||||
if (builder == null) {
|
||||
builder = MapperBuilders.object(currentFieldName).enabled(true).dynamic(dynamic).pathType(pathType);
|
||||
builder = MapperBuilders.object(currentFieldName).enabled(true).pathType(pathType);
|
||||
// if this is a non root object, then explicitly set the dynamic behavior if set
|
||||
if (!(this instanceof RootObjectMapper) && this.dynamic != Defaults.DYNAMIC) {
|
||||
((Builder) builder).dynamic(this.dynamic);
|
||||
}
|
||||
}
|
||||
BuilderContext builderContext = new BuilderContext(context.indexSettings(), context.path());
|
||||
objectMapper = builder.build(builderContext);
|
||||
|
|
Loading…
Reference in New Issue