From a043337380a90f85116b98adc9e6c706dc7343f5 Mon Sep 17 00:00:00 2001 From: Armin Date: Fri, 27 Oct 2017 10:59:14 +0200 Subject: [PATCH] #26990 prevent duplicate fields when mixing parent and root nested includes (follow up) --- .../org/elasticsearch/index/mapper/RootObjectMapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java index 6a9dbb282b5f..42341bfb96b2 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java @@ -96,12 +96,12 @@ private static void fixRedundantIncludes(ObjectMapper.Builder omb, boolean paren ObjectMapper.Builder child = (ObjectMapper.Builder) mapper; Nested nested = child.nested; boolean isNested = nested.isNested(); - boolean includedInParent = parentIncluded && isNested && nested.isIncludeInParent(); + boolean includeInRootViaParent = parentIncluded && isNested && nested.isIncludeInParent(); boolean includedInRoot = isNested && nested.isIncludeInRoot(); - if (includedInParent && includedInRoot) { + if (includeInRootViaParent && includedInRoot) { child.nested = Nested.newNested(true, false); } - fixRedundantIncludes(child, includedInParent || includedInRoot); + fixRedundantIncludes(child, includeInRootViaParent || includedInRoot); } } }