-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Avoid duplicate types deprecation messages in search-related APIs. #36802
Avoid duplicate types deprecation messages in search-related APIs. #36802
Conversation
Pinging @elastic/es-search |
8c76d19
to
774ff0c
Compare
@jtibshirani Thanks Julie for following up on this PR. Is the goal to have only a single deprecation message when a user submits a query that references a type field inside the body? Do we want to have a single deprecation even if a type is also used in the url? Currently with your PR if we have a type both in the url, and inside the body, we still get 2 deprecation warnings: |
Thanks @mayya-sharipova for taking a look. In your example, my goal was indeed to have two deprecation messages, because the user has specified a type in two distinct places. The situation I am trying to avoid is having two deprecation messages when there is only a type in the URL. |
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.
Thanks Julie! Makes sense!
@elasticmachine run gradle build tests 1 |
This PR moves the check for using the
_type
field in queries out ofTypeFieldType
and intoQueryShardContext#fieldMapper
.Currently, we issue two separate deprecation messages when APIs like 'search', 'explain', and 'update by query' include types in the URL, because these APIs create a term filter on
_type
as part of their execution. Moving the deprecation check intoQueryShardContext#fieldMapper
lets us avoid these duplicate messages.