diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml index d8db152e979..b5e98949f03 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml @@ -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 diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java index b96ada4cdd9..d0ec01dc552 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java @@ -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"); }