Skip to content

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