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

Switch to non-deprecated ParseField.match method for o.e.search #28526

Merged
merged 3 commits into from
Feb 8, 2018

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Feb 5, 2018

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.elasticsearch.search package.

Relates to #28504

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)) {
Copy link
Member

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())) {
Copy link
Member

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?

Copy link
Member

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.

@dakrone dakrone merged commit 2e4c834 into elastic:master Feb 8, 2018
dakrone added a commit that referenced this pull request Feb 8, 2018
* 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
@dakrone dakrone deleted the xcontent-xtract-search branch April 19, 2018 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants