Correctly handle mixed object paths in XContentMapValues#65539
Correctly handle mixed object paths in XContentMapValues#65539romseygeek merged 7 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-search (Team:Search) |
|
I've marked this for 7.11 but we could conceivably backport it to 7.10.1 as well. |
|
@elasticmachine update branch |
|
Thanks @romseygeek for fixing this! I noticed there's a related but slightly different edge case: Surprisingly, we allow documents to specify a field both in structured object and dot notation. When parsing, we index both values as if it were specified as an array. Your PR fixes the problem for |
I've pushed a test for your second case. |
…o bug/object-fields-fetch
When we have an object that looks like this:
```
{
"foo" : {
"cat": "meow"
},
"foo.bar" : "baz"
```
where the inner objects of foo are defined both as json objects and via
dot notation, then XContentMapValues.extractValue() will only descend
through the json object and will not collect values from the dot notated paths.
In these cases, the foo.bar values will not be returned in the fields
section of a search response.
This commit adds the ability to check both paths, ensuring that all relevant
values get returned as part of fields.
Fixes #65499
When we have an object that looks like this:
where the inner objects of
fooare defined both as json objects and viadot notation, then XContentMapValues.extractValue() will only descend
through the json object and will not collect values from the dot notated paths.
In these cases, the
foo.barvalues will not be returned in thefieldssection of a search response.
This commit adds the ability to check both paths, ensuring that all relevant
values get returned as part of
fields.Fixes #65499