Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix execution of exists query within nested queries on field with docvalues disabled #79462

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

romseygeek
Copy link
Contributor

The FieldNamesFieldMapper adds non-indexed fields to a special metadata
field so that exists queries can be run efficiently. This is built in a postParse
method that is run once per document. However, this means that nested
documents are not handled correctly - non-indexed field names are added to
the parent document's metadata field rather than to the nested document's
field.

This commit fixes things to add non-indexed field names directly to the
nested documents.

…_values disabled (elastic#78841)

The FieldNamesFieldMapper adds non-indexed fields to a special metadata
field so that exists queries can be run efficiently.  This is built in a postParse
method that is run once per document.  However, this means that nested
documents are not handled correctly - non-indexed field names are added to
the parent document's metadata field rather than to the nested document's
field.

This commit fixes things to add non-indexed field names directly to the
nested documents.
@romseygeek romseygeek self-assigned this Oct 19, 2021
@romseygeek romseygeek merged commit 115aabf into elastic:7.x Oct 19, 2021
@romseygeek romseygeek deleted the nested/fieldnames-7x branch October 19, 2021 13:47
romseygeek added a commit to romseygeek/elasticsearch that referenced this pull request Nov 3, 2021
…_values disabled (elastic#78841) (elastic#79462)

The FieldNamesFieldMapper adds non-indexed fields to a special metadata
field so that exists queries can be run efficiently.  This is built in a postParse
method that is run once per document.  However, this means that nested
documents are not handled correctly - non-indexed field names are added to
the parent document's metadata field rather than to the nested document's
field.

This commit fixes things to add non-indexed field names directly to the
nested documents.

Co-authored-by: Yoann Rodière <[email protected]>
romseygeek added a commit that referenced this pull request Nov 3, 2021
…_values disabled (#78841) (#79462) (#80274)

The FieldNamesFieldMapper adds non-indexed fields to a special metadata
field so that exists queries can be run efficiently.  This is built in a postParse
method that is run once per document.  However, this means that nested
documents are not handled correctly - non-indexed field names are added to
the parent document's metadata field rather than to the nested document's
field.

This commit fixes things to add non-indexed field names directly to the
nested documents.

Co-authored-by: Yoann Rodière <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants