-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Remove deprecated sort options: nested_path and nested_filter #42809
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
Conversation
This commit removes the nested_path and nested_filter options deprecated in 6x. This change also checks that the sort field has a [nested] option if it is under a nested object and throws an exception if it's not the case. Closes elastic#27098
|
Pinging @elastic/es-search |
cbuescher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some small nits, nothing that needs another round of review I think once the tests pass.
| [float] | ||
| ===== Removal of sort parameters | ||
|
|
||
| * The `nested_filter` and `nested_path` options, deprecated in 6.x, has been removed in favor of the `nested` context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/has/have
| // new nested sorts takes priority | ||
| nested = resolveNested(context, nestedSort); | ||
| } else { | ||
| nested = resolveNested(context, nestedPath, nestedFilter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like SortBuilder#resolveNested(QueryShardContext context, String nestedPath, QueryBuilder nestedFilter) is unused after this now and can be removed. I quickly tried it and didn't get compile errors, I might be missign sth. though.
| /** | ||
| * Throws an exception if the provided <code>field</code> requires a nested context. | ||
| */ | ||
| static void validateMissingNestedPath(QueryShardContext context, String field) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth adding a unit test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scratch that, just was that FieldSortIT#testNestedSort covers at least the exception. I'll leave it up to you to decide if there are other cases that need checking.
This commit removes the nested_path and nested_filter options deprecated in 6x.
This change also checks that the sort field has a [nested] option if it is under a nested
object and throws an exception if it's not the case.
Closes #27098