-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Switch to non-deprecated ParseField.match method for o.e.search #28526
Conversation
This replaces more of the `ParseField.match` calls with the same call using a deprecation handler. It encapsulates all of the instances in the `org.elastsicsearch.search` package. Relates to elastic#28504
@@ -131,7 +132,7 @@ public ParseField parseField() { | |||
public static SubAggCollectionMode parse(String value) { | |||
SubAggCollectionMode[] modes = SubAggCollectionMode.values(); | |||
for (SubAggCollectionMode mode : modes) { | |||
if (mode.parseField.match(value)) { | |||
if (mode.parseField.match(value, LoggingDeprecationHandler.INSTANCE)) { |
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.
I think it'd be cleaner to take the DeprecationHandler
as an argument here. I really want to minimize the places where we use the static instance of LoggingDeprecationHandler
. My ulterior motive is that we might be able to remove it entirely at some point which would be super neat.
script = Script.parse(parser); | ||
} else if (SearchSourceBuilder.IGNORE_FAILURE_FIELD.match(currentFieldName)) { | ||
} else if (SearchSourceBuilder.IGNORE_FAILURE_FIELD.match(currentFieldName, | ||
parser.getDeprecationHandler())) { |
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.
Just like last time, would you mind indenting this one more level?
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.
If you think we shouldn't I'm ok with it but I find it so much more readable that way.
* Switch to non-deprecated ParseField.match method for o.e.search This replaces more of the `ParseField.match` calls with the same call using a deprecation handler. It encapsulates all of the instances in the `org.elastsicsearch.search` package. Relates to #28504 * Address Nik's comments
This replaces more of the
ParseField.match
calls with the same call using adeprecation handler. It encapsulates all of the instances in the
org.elasticsearch.search
package.Relates to #28504