-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Remove several parse field deprecations in query builders #26711
Remove several parse field deprecations in query builders #26711
Conversation
bf1d915
to
071a506
Compare
071a506
to
9ea87f4
Compare
@@ -123,9 +110,13 @@ public MatchQueryBuilder(StreamInput in) throws IOException { | |||
super(in); | |||
fieldName = in.readString(); | |||
value = in.readGenericValue(); | |||
type = MatchQuery.Type.readFromStream(in); | |||
if (in.getVersion().onOrAfter(Version.V_6_0_0_rc1)) { |
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.
This assumes these changes should and can be backported to 6.0.0
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.
The logic seems wrong. I think it should be before
and not onOrAfter
?
Also you should do that in multiple steps to avoid build failures. Start with current version (v7), then backport to v6 and when the build is green you can change the expected version here to be v6. You can add a TODO comment to make sure that reviewers understand the expectations.
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, of course it should be before, bad copy error on my side. Looking at this, I think I will pull out the MatchQueryBuilder changes to a separate PR since I think it will make backporting easier, the rest of this PR is more straight forward.
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 for doing this @cbuescher !
I left some comments.
@@ -123,9 +110,13 @@ public MatchQueryBuilder(StreamInput in) throws IOException { | |||
super(in); | |||
fieldName = in.readString(); | |||
value = in.readGenericValue(); | |||
type = MatchQuery.Type.readFromStream(in); | |||
if (in.getVersion().onOrAfter(Version.V_6_0_0_rc1)) { |
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.
The logic seems wrong. I think it should be before
and not onOrAfter
?
Also you should do that in multiple steps to avoid build failures. Start with current version (v7), then backport to v6 and when the build is green you can change the expected version here to be v6. You can add a TODO comment to make sure that reviewers understand the expectations.
operator = Operator.readFromStream(in); | ||
slop = in.readVInt(); | ||
if (in.getVersion().onOrAfter(Version.V_6_0_0_rc1)) { |
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.
same here
@@ -146,9 +137,13 @@ public MatchQueryBuilder(StreamInput in) throws IOException { | |||
protected void doWriteTo(StreamOutput out) throws IOException { | |||
out.writeString(fieldName); | |||
out.writeGenericValue(value); | |||
type.writeTo(out); | |||
if (out.getVersion().onOrAfter(Version.V_6_0_0_rc1)) { | |||
MatchQuery.Type.BOOLEAN.writeTo(out); |
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.
and here
operator.writeTo(out); | ||
out.writeVInt(slop); | ||
if (out.getVersion().onOrAfter(Version.V_6_0_0_rc1)) { |
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.
;)
The `fielddata` field and the use of the `_name` field in the short syntax of the range query have been deprecated in 5.0 and can be removed.
All of these have already been deprecated in 5.0 and can thus be removed in 6.0.
9ea87f4
to
b9273d8
Compare
@jimczi thanks for the review, I pulled out the changes in the MatchQueryBuilder and related test into #26720 to make this PR a little smaller and easier to backport. Is there anything to the remaining part you would like to be changed? I was planning to add the notes to the migration docs only when backporting to the 6.0 branch. |
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.
LGTM
The `fielddata` field and the use of the `_name` field in the short syntax of the range query have been deprecated in 5.0 and can be removed. The same goes for the deprecated `score_mode` field in HasParentQueryBuilder, the deprecated `like_text`, `ids` and `docs` parameter in the `more_like_this` query, the deprecated query name in the short version of the `regexp` query, and several deprecated alternative field names in other query builders.
The `fielddata` field and the use of the `_name` field in the short syntax of the range query have been deprecated in 5.0 and can be removed. The same goes for the deprecated `score_mode` field in HasParentQueryBuilder, the deprecated `like_text`, `ids` and `docs` parameter in the `more_like_this` query, the deprecated query name in the short version of the `regexp` query, and several deprecated alternative field names in other query builders.
* master: [DOCS] Added index-shared4 and index-shared5.asciidoc BulkProcessor flush runnable preserves the thread context from creation time (elastic#26718) Catch exceptions and inform handler in RemoteClusterConnection#collectNodes (elastic#26725) [Docs] Fix name of character filter in example. (elastic#26724) Remove parse field deprecations in query builders (elastic#26711) elastic#26720: Set the correct bwc version after backport to 6.0 Remove deprecated type and slop field in MatchQueryBuilder (elastic#26720) Refactoring of Gateway*** classes (elastic#26706) Make RestHighLevelClient's Request class public (elastic#26627) Deguice ActionFilter (elastic#26691) aggs: Allow aggregation sorting via nested aggregation. Build: Set bwc builds to always set snapshot (elastic#26704) File Discovery: Remove fallback with zen discovery (elastic#26667)
This change removes parse fields that are either completely deprecated since version 5.0 or removes deprecated names.
This PR is opened against master, but should be backported to the 6.x and 6.0 branches with additional notes
to the migration docs in 6.0.