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;