From af3d6fe6e53f42933b652610d765dde8908ba319 Mon Sep 17 00:00:00 2001 From: olcbean Date: Thu, 8 Mar 2018 16:13:20 +0100 Subject: [PATCH 1/3] REST : deprecate `field_data` for Clear Indices Cache API --- .../action/admin/indices/RestClearIndicesCacheAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b96ada4cdd974..d0ec01dc552e4 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 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())); @@ -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"); } From 05d32b5458110db3743c3e22d6d0e199655f1fbe Mon Sep 17 00:00:00 2001 From: olcbean Date: Thu, 8 Mar 2018 18:51:15 +0100 Subject: [PATCH 2/3] adding a note to the migration docs --- docs/reference/migration/migrate_7_0/indices.asciidoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/reference/migration/migrate_7_0/indices.asciidoc b/docs/reference/migration/migrate_7_0/indices.asciidoc index 16e437b4156e8..251c5e10f8447 100644 --- a/docs/reference/migration/migrate_7_0/indices.asciidoc +++ b/docs/reference/migration/migrate_7_0/indices.asciidoc @@ -55,3 +55,8 @@ traffic for `index.search.idle.after` seconds (defaults to `30s`). Searches that access a search idle shard will be "parked" until the next refresh happens. Indexing requests with `wait_for_refresh` will also trigger a background refresh. + +==== `field_data` param deprecated in favor of `fielddata`. + +The `field_data` url parameter has been deprecated in favor of `fielddata` for +Clear Indices Cache API. From 0aac8e29c93154c18167201f4663d04a170494c9 Mon Sep 17 00:00:00 2001 From: olcbean Date: Tue, 13 Mar 2018 12:59:35 +0100 Subject: [PATCH 3/3] add a yaml test for the depr `field_data` --- .../migration/migrate_7_0/indices.asciidoc | 5 ---- .../test/indices.clear_cache/10_basic.yml | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/reference/migration/migrate_7_0/indices.asciidoc b/docs/reference/migration/migrate_7_0/indices.asciidoc index 251c5e10f8447..16e437b4156e8 100644 --- a/docs/reference/migration/migrate_7_0/indices.asciidoc +++ b/docs/reference/migration/migrate_7_0/indices.asciidoc @@ -55,8 +55,3 @@ traffic for `index.search.idle.after` seconds (defaults to `30s`). Searches that access a search idle shard will be "parked" until the next refresh happens. Indexing requests with `wait_for_refresh` will also trigger a background refresh. - -==== `field_data` param deprecated in favor of `fielddata`. - -The `field_data` url parameter has been deprecated in favor of `fielddata` for -Clear Indices Cache API. 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 d8db152e979b0..b5e98949f03b4 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