Avoid duplicate types deprecation messages in search-related APIs.#36802
Avoid duplicate types deprecation messages in search-related APIs.#36802jtibshirani merged 2 commits intoelastic:masterfrom
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. |
mayya-sharipova
left a comment
There was a problem hiding this comment.
Thanks Julie! Makes sense!
|
@elasticmachine run gradle build tests 1 |

This PR moves the check for using the
_typefield in queries out ofTypeFieldTypeand 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
_typeas part of their execution. Moving the deprecation check intoQueryShardContext#fieldMapperlets us avoid these duplicate messages.