mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Remove deprecated url parameters _source_include
and _source_exclude
(#35097)
Removes `_source_include` and `_source_exclude` url parameters. These parameters have been deprecated in #33475. Closes #22792
This commit is contained in:
parent
f87a53451b
commit
d181d1bab1
docs/reference/migration/migrate_7_0
rest-api-spec/src/main/resources/rest-api-spec/test/get
server/src/main/java/org/elasticsearch/search/fetch/subphase
@ -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
|
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
|
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.
|
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.
|
||||||
|
@ -70,37 +70,3 @@
|
|||||||
- match: { _id: "1" }
|
- match: { _id: "1" }
|
||||||
- match: { fields.count: [1] }
|
- match: { fields.count: [1] }
|
||||||
- match: { _source.include.field1: v1 }
|
- 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"
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package org.elasticsearch.search.fetch.subphase;
|
package org.elasticsearch.search.fetch.subphase;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.elasticsearch.common.Booleans;
|
import org.elasticsearch.common.Booleans;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
@ -27,7 +26,6 @@ import org.elasticsearch.common.Strings;
|
|||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
|
||||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
@ -46,8 +44,6 @@ import java.util.function.Function;
|
|||||||
*/
|
*/
|
||||||
public class FetchSourceContext implements Writeable, ToXContentObject {
|
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 INCLUDES_FIELD = new ParseField("includes", "include");
|
||||||
public static final ParseField EXCLUDES_FIELD = new ParseField("excludes", "exclude");
|
public static final ParseField EXCLUDES_FIELD = new ParseField("excludes", "exclude");
|
||||||
|
|
||||||
@ -110,21 +106,11 @@ public class FetchSourceContext implements Writeable, ToXContentObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String sIncludes = request.param("_source_includes");
|
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) {
|
if (sIncludes != null) {
|
||||||
sourceIncludes = Strings.splitStringByCommaToArray(sIncludes);
|
sourceIncludes = Strings.splitStringByCommaToArray(sIncludes);
|
||||||
}
|
}
|
||||||
|
|
||||||
String sExcludes = request.param("_source_excludes");
|
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) {
|
if (sExcludes != null) {
|
||||||
sourceExcludes = Strings.splitStringByCommaToArray(sExcludes);
|
sourceExcludes = Strings.splitStringByCommaToArray(sExcludes);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user