diff --git a/docs/reference/migration/migrate_7_0/api.asciidoc b/docs/reference/migration/migrate_7_0/api.asciidoc index 71a8e1aa0150c..34720bb182d4d 100644 --- a/docs/reference/migration/migrate_7_0/api.asciidoc +++ b/docs/reference/migration/migrate_7_0/api.asciidoc @@ -102,3 +102,8 @@ status 200 - OK is now returned instead at all times. The Put User API response was changed in 6.5.0 to add the `created` field outside of the user object where it previously had been. In 7.0.0 the user object has been removed in favor of the top level `created` field. + +[float] +==== Source filtering url parameters `_source_include` and `_source_exclude` have been removed + +The deprecated in 6.x url parameters are now removed. Use `_source_includes` and `_source_excludes` instead. diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml index b1f81db92d682..f9247d1076159 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml @@ -70,37 +70,3 @@ - match: { _id: "1" } - match: { fields.count: [1] } - match: { _source.include.field1: v1 } - ---- -"Deprecated _source_include and _source_exclude": - - - skip: - version: " - 6.5.99" - reason: _source_include and _source_exclude are deprecated from 6.6.0 - features: "warnings" - - - do: - indices.create: - index: test_1 - body: - mappings: - _doc: - properties: - count: - type: integer - store: true - - - do: - index: - index: test_1 - type: _doc - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - get: { index: test_1, type: _doc, id: 1, _source_include: include.field1 } - warnings: - - "Deprecated parameter [_source_include] used, expected [_source_includes] instead" - - do: - get: { index: test_1, type: _doc, id: 1, _source_includes: include, _source_exclude: "*.field2" } - warnings: - - "Deprecated parameter [_source_exclude] used, expected [_source_excludes] instead" diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java index 359fca2fc3db1..5298e7eca0586 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java @@ -19,7 +19,6 @@ package org.elasticsearch.search.fetch.subphase; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.common.Booleans; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParsingException; @@ -27,7 +26,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; @@ -46,8 +44,6 @@ */ public class FetchSourceContext implements Writeable, ToXContentObject { - private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(FetchSourceContext.class)); - public static final ParseField INCLUDES_FIELD = new ParseField("includes", "include"); public static final ParseField EXCLUDES_FIELD = new ParseField("excludes", "exclude"); @@ -110,21 +106,11 @@ public static FetchSourceContext parseFromRestRequest(RestRequest request) { } String sIncludes = request.param("_source_includes"); - String sInclude = request.param("_source_include"); - if (sInclude != null) { - DEPRECATION_LOGGER.deprecated("Deprecated parameter [_source_include] used, expected [_source_includes] instead"); - sIncludes = sInclude; - } if (sIncludes != null) { sourceIncludes = Strings.splitStringByCommaToArray(sIncludes); } String sExcludes = request.param("_source_excludes"); - String sExclude = request.param("_source_exclude"); - if (sExclude != null) { - DEPRECATION_LOGGER.deprecated("Deprecated parameter [_source_exclude] used, expected [_source_excludes] instead"); - sExcludes = sExclude; - } if (sExcludes != null) { sourceExcludes = Strings.splitStringByCommaToArray(sExcludes); }