Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/136315.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 136315
summary: Store full path in `_ignored` when ignoring dynamic array field
area: Mapping
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ public void testIgnoreDynamicBeyondLimitObjectMultiField() {
});
}

public void testIgnoreDynamicBeyondLimitObjectArrayField() {
indexIgnoreDynamicBeyond(2, orderedMap("a", orderedMap("b", 1, "c", List.of(2, 3, 4))), fields -> {
assertThat(fields.keySet(), equalTo(Set.of("a.b", "_ignored")));
assertThat(fields.get("a.b").getValues(), Matchers.contains(1L));
assertThat(fields.get("_ignored").getValues(), Matchers.contains("a.c"));
});
}

public void testIgnoreDynamicBeyondLimitRuntimeFields() {
indexIgnoreDynamicBeyond(1, orderedMap("field1", 1, "field2", List.of(1, 2)), Map.of("dynamic", "runtime"), fields -> {
assertThat(fields.keySet(), equalTo(Set.of("field1", "_ignored")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ private static void parseArrayDynamic(DocumentParserContext context, String curr
throw new IllegalArgumentException("failed to parse field [" + currentFieldName + " ]", e);
}
}
context.addIgnoredField(currentFieldName);
context.addIgnoredField(context.path().pathAsText(currentFieldName));
return;
}
parseNonDynamicArray(context, objectMapperFromTemplate, currentFieldName, currentFieldName);
Expand Down