Skip to content
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

Merged
merged 2 commits into from
Dec 19, 2018

Conversation

jtibshirani
Copy link
Contributor

@jtibshirani jtibshirani commented Dec 18, 2018

This PR moves the check for using the _type field in queries out of TypeFieldType and into QueryShardContext#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 into QueryShardContext#fieldMapper lets us avoid these duplicate messages.

@jtibshirani jtibshirani added >bug :Search/Search Search-related issues that do not fall into other categories v7.0.0 labels Dec 18, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@mayya-sharipova
Copy link
Contributor

@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:

screenshot 2018-12-18 19 14 58

@jtibshirani
Copy link
Contributor Author

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.

Copy link
Contributor

@mayya-sharipova mayya-sharipova left a 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!

@jtibshirani
Copy link
Contributor Author

@elasticmachine run gradle build tests 1

@jtibshirani jtibshirani merged commit 32ef80f into elastic:master Dec 19, 2018
@jtibshirani jtibshirani deleted the search-deprecation-messages branch December 19, 2018 20:59
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants