Deprecate _type in simulate pipeline requests#37949
Deprecate _type in simulate pipeline requests#37949AthenaEryma merged 15 commits intoelastic:masterfrom
_type in simulate pipeline requests#37949Conversation
As mapping types are being removed throughout Elasticsearch, the use of `_type` in pipeline simulation requests is deprecated.
|
Pinging @elastic/es-core-features |
jpountz
left a comment
There was a problem hiding this comment.
Thanks @gwbrown for tackling this.
| "Specifying _type in pipeline simulation requests is deprecated."); | ||
| } | ||
| String type = ConfigurationUtils.readStringOrIntProperty(null, null, | ||
| dataMap, MetaData.TYPE.getFieldName(), "_type"); |
There was a problem hiding this comment.
we have been using _doc as a default type name elsewhere (there is a constant for it at MapperService.SINGLE_TYPE_NAME)
There was a problem hiding this comment.
I did notice that, but I wasn't sure if we wanted to switch it out here as this API has been using _type as the default for quite a while. What are your thoughts, @jakelandis?
server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestParsingTests.java
Outdated
Show resolved
Hide resolved
|
LGTM with a minor preference to use |
| { | ||
| "_index": "index", | ||
| "_type": "_doc", | ||
| "_type": "_type", |
There was a problem hiding this comment.
I would go ahead and remove the _type example here (and below) as well. We don't to encourage users to do anything with it.
There was a problem hiding this comment.
This is an example of the output of the call, which will have the _type field present. However, it looks like we can just provide null for the type to the IngestDocument if one isn't provided in the request and _type will be omitted from the response - what do you think of doing that instead of changing the default to _doc?
I've removed _type from all of the example inputs already.
There was a problem hiding this comment.
However, it looks like we can just provide null for the type to the IngestDocument if one isn't provided in the request and _type will be omitted from the response - what do you think of doing that instead of changing the default to _doc
I think we should keep the "_type": "_doc" on the return values since it better mirrors the return of a typeless search
POST foo/_create/1
{}
GET foo/_search
Also, this line (164) is from the request, and there are some responses with it missing (for example 186-187).
|
I've pushed changes that:
How do folks feel about this as opposed to changing the default |
| String type = ConfigurationUtils.readStringOrIntProperty(null, null, | ||
| dataMap, MetaData.TYPE.getFieldName(), "_type"); | ||
| if (dataMap.containsKey(MetaData.TYPE.getFieldName())) { | ||
| deprecationLogger.deprecatedAndMaybeLog("type_in_pipeline_simulation", |
There was a problem hiding this comment.
Small comment, but for consistency with our other logging statements it'd be nice to (1) use the key simulate_pipeline_with_types, and (2) prefix the warning message with [types removal]. Adding a prefix to messages was a bit unusual, but we needed a way to identify and ignore types-related warnings in tests.
| { | ||
| "_index": "index", | ||
| "_type": "_doc", | ||
| "_type": "_type", |
|
One note in addition to the small comments above: I think we'll need to update |
…-lease-expiration * elastic/master: (24 commits) Add support for API keys to access Elasticsearch (elastic#38291) Add typless client side GetIndexRequest calls and response class (elastic#37778) Limit token expiry to 1 hour maximum (elastic#38244) add docs saying mixed-cluster ILM is not supported (elastic#37954) Skip unsupported languages for tests (elastic#38328) Deprecate `_type` in simulate pipeline requests (elastic#37949) Mute testCannotShrinkLeaderIndex (elastic#38374) Tighten mapping syncing in ccr remote restore (elastic#38071) Add test for `PutFollowAction` on a closed index (elastic#38236) Fix SSLContext pinning to TLSV1.2 in reload tests (elastic#38341) Mute RareClusterStateIT.testDelayedMappingPropagationOnReplica (elastic#38357) Deprecate types in rollover index API (elastic#38039) Types removal - fix FullClusterRestartIT warning expectations (elastic#38310) Fix ILM explain response to allow unknown fields (elastic#38054) Mute testFollowIndexAndCloseNode (elastic#38360) Docs: Drop inline callout from scroll example (elastic#38340) Deprecate HLRC security methods (elastic#37883) Remove types from Monitoring plugin "backend" code (elastic#37745) Add Composite to AggregationBuilders (elastic#38207) Clarify slow cluster-state log messages (elastic#38302) ...
As mapping types are being removed throughout Elasticsearch, the use of
_typein pipeline simulation requests is deprecated.Closes #37731