From a46d2f21c6504c8ff8cb98a2180293994b857a03 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Fri, 11 Mar 2016 09:55:21 +0100 Subject: [PATCH] Fix dynamic mapper bug with deeply nested fields. --- .../java/org/elasticsearch/index/mapper/DocumentParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java b/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java index 8c8ded9b543..cf0c0fbba33 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java @@ -316,7 +316,8 @@ final class DocumentParser implements Closeable { while (i < nameParts.length - 1 && last.getMapper(nameParts[i]) != null) { Mapper newLast = last.getMapper(nameParts[i]); assert newLast instanceof ObjectMapper; - parentMappers.add((ObjectMapper)newLast); + last = (ObjectMapper) newLast; + parentMappers.add(last); ++i; } return i;