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

REST : deprecate field_data for Clear Indices Cache API #28943

Merged
merged 3 commits into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,26 @@
- 'Deprecated field [request_cache] used, expected [request] instead'
indices.clear_cache:
request_cache: false

---
"clear_cache with field_data set to true":
- skip:
version: " - 6.2.99"
reason: field_data was deprecated in 6.3.0
features: "warnings"

- do:
warnings:
- 'Deprecated field [field_data] used, expected [fielddata] instead'
indices.clear_cache:
field_data: true

---
"clear_cache with fielddata set to true":
- skip:
version: " - 6.2.99"
reason: fielddata was deprecated before 6.3.0

- do:
indices.clear_cache:
fielddata: true
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static ClearIndicesCacheRequest fromRequest(final RestRequest request, Cl
clearIndicesCacheRequest.queryCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.queryCache()));
} else if (Fields.REQUEST.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) {
clearIndicesCacheRequest.requestCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.requestCache()));
} else if (Fields.FIELD_DATA.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) {
} else if (Fields.FIELDDATA.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) {
clearIndicesCacheRequest.fieldDataCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.fieldDataCache()));
} else if (Fields.FIELDS.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) {
clearIndicesCacheRequest.fields(request.paramAsStringArray(entry.getKey(), clearIndicesCacheRequest.fields()));
Expand All @@ -101,7 +101,7 @@ public static ClearIndicesCacheRequest fromRequest(final RestRequest request, Cl
public static class Fields {
public static final ParseField QUERY = new ParseField("query", "filter", "filter_cache");
public static final ParseField REQUEST = new ParseField("request", "request_cache");
public static final ParseField FIELD_DATA = new ParseField("field_data", "fielddata");
public static final ParseField FIELDDATA = new ParseField("fielddata", "field_data");
public static final ParseField FIELDS = new ParseField("fields");
}

Expand Down