Skip to content

[8.3] Don't run include_in_parent when in copy_to context (#87123)#87508

Merged
elasticsearchmachine merged 1 commit intoelastic:8.3from
romseygeek:backport/8.3/pr-87123
Jun 8, 2022
Merged

[8.3] Don't run include_in_parent when in copy_to context (#87123)#87508
elasticsearchmachine merged 1 commit intoelastic:8.3from
romseygeek:backport/8.3/pr-87123

Conversation

@romseygeek
Copy link
Copy Markdown
Contributor

Backports the following commits to 8.3:

We changed how copy_to is implemented in elastic#79922, which moved
the handling of dots in field names into a specialised parser. Unfortunately,
while doing this we added a bug whereby every time a copy_to directive
is processed for a nested field, the nested field's include_in_parent logic
would be run, meaning that the parent would end up with multiple copies
of the nested child's fields.

This commit fixes this by only running include_in_parent when the parser
is not in a copy_to context. It also fixes another bug that meant the parent
document would contain multiple copies of the ID field.

Fixes elastic#87036
@romseygeek romseygeek added :Search Foundations/Mapping Index mappings, including merging and defining field types >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Search Meta label for search team labels Jun 8, 2022
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (Team:Search)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v8.3.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants