REST: deprecate `field_data` in Clear Cache API (#28943)
We call it `fielddata` everywhere else in the code and API so we may as well be consistent.
This commit is contained in:
parent
5904d936fa
commit
edc57f6f34
|
@ -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
|
||||
|
|
|
@ -88,7 +88,7 @@ public class RestClearIndicesCacheAction extends BaseRestHandler {
|
|||
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()));
|
||||
|
@ -101,7 +101,7 @@ public class RestClearIndicesCacheAction extends BaseRestHandler {
|
|||
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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue