Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…112704_fix
  • Loading branch information
astefan committed Sep 19, 2024
2 parents aecd148 + e244216 commit 4bdd904
Show file tree
Hide file tree
Showing 16 changed files with 625 additions and 25 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/112706.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112706
summary: Configure keeping source in `FieldMapper`
area: Mapping
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ private Optional<MatchResult> matchWithFieldSpecificMatcher(String fieldName, Li

// Checks for scenarios when source is stored exactly and therefore can be compared without special logic.
private boolean sourceMatchesExactly(MappingTransforms.FieldMapping mapping, List<Object> expectedValues) {
return mapping.parentMappingParameters().stream().anyMatch(m -> m.getOrDefault("enabled", "true").equals("false"));
return mapping.parentMappingParameters().stream().anyMatch(m -> m.getOrDefault("enabled", "true").equals("false"))
|| mapping.mappingParameters().getOrDefault("synthetic_source_keep", "none").equals("all")
|| expectedValues.size() > 1 && mapping.mappingParameters().getOrDefault("synthetic_source_keep", "none").equals("arrays");
}

private MatchResult matchWithGenericMatcher(List<Object> actualValues, List<Object> expectedValues) {
Expand Down
6 changes: 6 additions & 0 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ tests:
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=indices.create/21_synthetic_source_stored/index param - nested array within array}
issue: https://github.com/elastic/elasticsearch/issues/113173
- class: org.elasticsearch.packaging.test.WindowsServiceTests
method: test33JavaChanged
issue: https://github.com/elastic/elasticsearch/issues/113177
- class: org.elasticsearch.xpack.inference.rest.ServerSentEventsRestActionListenerTests
method: testErrorMidStream
issue: https://github.com/elastic/elasticsearch/issues/113179

# Examples:
#
Expand Down
Loading

0 comments on commit 4bdd904

Please sign in to comment.