From d8adcb3230f2779a44a91956936f976cf324e04c Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Wed, 23 Mar 2022 14:37:02 +0100 Subject: [PATCH] Skip parsing arrays when dynamic is false --- .../java/org/elasticsearch/index/mapper/DocumentParser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java index 4e805afb9e2be..6c94f777e2bc2 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java @@ -660,8 +660,7 @@ private static void parseArray(DocumentParserContext context, ObjectMapper paren if (dynamic == ObjectMapper.Dynamic.STRICT) { throw new StrictDynamicMappingException(parentMapper.fullPath(), arrayFieldName); } else if (dynamic == ObjectMapper.Dynamic.FALSE) { - // TODO: shouldn't this skip, not parse? - parseNonDynamicArray(context, parentMapper, lastFieldName, arrayFieldName); + context.parser().skipChildren(); } else { Mapper objectMapperFromTemplate = dynamic.getDynamicFieldsBuilder().createObjectMapperFromTemplate(context, arrayFieldName); if (objectMapperFromTemplate == null) {