Skip to content

Don't use TypeField for nested filters #44482

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

Merged
merged 3 commits into from
Jul 29, 2019

Conversation

romseygeek
Copy link
Contributor

We changed things in #27469 to filter parent
docs by using an exists query on the primary_term field. However, the equivalent query
for nested documents is still using the type field. This commit makes newNestedFilter
build the complement of newNonNestedFilter instead.

@romseygeek romseygeek added :Search/Search Search-related issues that do not fall into other categories >refactoring v8.0.0 v7.4.0 labels Jul 17, 2019
@romseygeek romseygeek requested a review from s1monw July 17, 2019 09:44
@romseygeek romseygeek self-assigned this Jul 17, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's important for the query that identifies root documents to be fast and avoid pure negations, but I think it's fine for the query that identifies nested documents.

@romseygeek romseygeek merged commit 899394d into elastic:master Jul 29, 2019
@romseygeek romseygeek deleted the nested-query-type branch July 29, 2019 09:22
@romseygeek romseygeek removed the v7.4.0 label Jul 29, 2019
@romseygeek
Copy link
Contributor Author

I'm not going to backport this to 7.x, as newNonNestedFilter requires an index version there which will change the signature of newNestedFilter

jkakavas pushed a commit that referenced this pull request Jul 31, 2019
We changed things in #27469 to filter parent docs by using an exists query on the 
primary_term field. However, the equivalent query for nested documents is still using 
the type field. This commit makes newNestedFilter build the complement of 
newNonNestedFilter instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Search/Search Search-related issues that do not fall into other categories v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants