-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation tracking for 7.0 types deprecation. #35190
Comments
Pinging @elastic/es-search-aggs |
CC @elastic/es-clients |
One last thing I want to raise which might be super contentious: Right now the default for
Can we remove some of the confusion of
Upgrades will have to account for the type removal whether the Are we actually doing our users a disservice by holding on to a deprecation period? |
The proposal is in 7.0 we will introduce deprecation warnings when saved queries with types are executed, but not do anything to proactively detect and upgrade them automatically. Some of the easier type removals would be in the structured metadata held around a saved search whereas other changes may be buried in clauses embedded in the saved search's choice of query DSL. |
@Mpdreamz I'm thinking that this could be an issue for mixed version clusters that have 6.latest and 7.0 nodes as the response format would depend on the version of the node that you are querying? |
This is typically dealt with in the following fashion:
The suggestion above follows this pattern, which is good. The only difference with what we do normally is the duration of deprecation. Normally it will be scoped down to something like OLD_MAJOR.latest. With the above suggestion it's NEW_MAJOR.x , which is a long time. I wonder if we should look at the costs of backporting the changes made to 6.x so we can follow our standard path. |
In the beginning this flag was supposed to exist on most APIs including some of the most used like the document APIs. This made me view the long deprecation period as a feature. Now that it's only about the mappings APIs, I could change my mind. One subtlety with backporting to 6.x is that it might still have 5.x indices that have multiple types, so |
…rom `_doc`. This commit makes `document`, `update`, `explain`, `termvectors` and `mapping` typeless APIs work on indices that have a type whose name is not `_doc`. Unfortunately, this needs to be a bit of a hack since I didn't want calls with random type names to see documents with the type name that the user had chosen upon type creation. The `explain` and `termvectors` do not support being called without a type for now so the test is just using `_doc` as a type for now, we will need to fix tests later but this shouldn't require further changes server-side since passing `_doc` as a type name is what typeless APIs do internally anyway. Relates elastic#35190
I looked into auto-detecting PUTs of typeless mappings/templates to see if we can avoid the need for passing an |
Turns out there's more to auto-detecting no-types than checking for the presence of a top-level While it would have been nice to auto-detect typeless mappings and provide the 7.0 examples in reference docs without any types this would not be consistent with the results of Does auto-detection still seem useful or shall we insist on documenting APIs with |
…rom `_doc` (#35790) This commit makes `document`, `update`, `explain`, `termvectors` and `mapping` typeless APIs work on indices that have a type whose name is not `_doc`. Unfortunately, this needs to be a bit of a hack since I didn't want calls with random type names to see documents with the type name that the user had chosen upon type creation. The `explain` and `termvectors` do not support being called without a type for now so the test is just using `_doc` as a type for now, we will need to fix tests later but this shouldn't require further changes server-side since passing `_doc` as a type name is what typeless APIs do internally anyway. Relates #35190
…stic#37484) Added deprecation warnings for use of include_type_name in put/get index templates. HLRC changes: GetIndexTemplateRequest has a new client-side class which is a copy of server's GetIndexTemplateResponse but modified to be typeless. PutIndexTemplateRequest has a new client-side counterpart which doesn't use types in the mappings Relates to elastic#35190
Added deprecation warnings for use of include_type_name in put/get index templates. HLRC changes: * GetIndexTemplateRequest has a new client-side class which is a copy of server's GetIndexTemplateResponse but modified to be typeless. * PutIndexTemplateRequest has a new client-side counterpart which doesn't use types in the mappings Relates to #35190
Backport for elastic#38039 Relates to elastic#35190
Backport for elastic#38039 Relates to elastic#35190
) The HLRC client currently uses `org.elasticsearch.action.admin.indices.get.GetIndexRequest` and `org.elasticsearch.action.admin.indices.get.GetIndexResponse` in its get index calls. Both request and response are designed for the typed APIs, including some return types e.g. for `getMappings()` which in the maps it returns still use a level including the type name. In order to change this without breaking existing users of the HLRC API, this PR introduces two new request and response objects in the `org.elasticsearch.client.indices` client package. These are used by the IndicesClient#get and IndicesClient#exists calls now by default and support the type-less API. The old request and response objects are still kept for use in similarly named, but deprecated methods. The newly introduced client side classes are simplified versions of the server side request/response classes since they don't need to support wire serialization, and only the response needs fromXContent parsing (but no xContent-serialization, since this is the responsibility of the server-side class). Also changing the return type of `GetIndexResponse#getMapping` to `Map<String, MappingMetaData> getMappings()`, while it previously was returning another map keyed by the type-name. Similar getters return simple Maps instead of the ImmutableOpenMaps that the server side response objects return. Backport for #37778 Relates to #35190
…stic#37484) Added deprecation warnings for use of include_type_name in put/get index templates. HLRC changes: GetIndexTemplateRequest has a new client-side class which is a copy of server's GetIndexTemplateResponse but modified to be typeless. PutIndexTemplateRequest has a new client-side counterpart which doesn't use types in the mappings Relates to elastic#35190
Added deprecation warnings for use of include_type_name in put/get index templates. HLRC changes: * GetIndexTemplateRequest has a new client-side class which is a copy of server's GetIndexTemplateResponse but modified to be typeless. * PutIndexTemplateRequest has a new client-side counterpart which doesn't use types in the mappings Relates to #35190
I logged #38637 to further address this point. |
…8825) We expect many users to have a custom document type in 6.x, for example they might have used `doc` when creating indices. In this case, users cannot easily switch over to typeless index creations in 6.7 using `include_type_name=false`, because the rest of their document CRUD calls will refer to the custom type. Instead, we are recommending that users take the following steps: set `include_type_name=true` in 6.7 for all relevant calls, upgrade to 7.0, then switch over completely to the typeless APIs and stop using `include_type_name`. This means that it will be very common to set `include_type_name=true` in 6.7, so it is misleading to emit a deprecation warning to tell the user to switch to using `include_type_name=false`. This PR switches to emitting a deprecation warning only if `include_type_name` is not set at all. The warning serves as an important note to users that the request and response format of these APIs will change in a breaking way in 7.0. Relates to #35190.
All items have been completed. |
Tracks the details of the 'In 7.0' part of this comment: #15613 (comment)
Plan for 7.0
_type
field, but we will return the dummy name_doc
regardless of the underlying type name.include_type_name
that should be set tofalse
to omit types in requests + responses. It will default totrue
in 6.7 with a warning that it needs to be explicitly specified (to eithertrue
orfalse
), default tofalse
in 7.0 with a warning to stop specifying it, and finally be removed in 8.0.More information can be found here: https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
To-do List
Phase One: Add Typeless APIs. These items are critical for 6.7/ 7.0, and should be in before feature freeze.
include_type_name
parameter from the bulk, delete, get, index, update, and search APIs. @jtibshirani Remove include_type_name from the relevant APIs. #35192include_type_name
is added to APIs that we missed, and has the right default values on both 6.7 and 7.0. @jtibshirani Support include_type_name in the field mapping and index template APIs. #37210 Update the default for include_type_name to false. #37285_type
. #29468_doc
, then typeless API calls still work. Currently in this situation, using certain typeless APIs will produce an error due to a mismatched type name. @jpountz Make typeless APIs usable with indices whose type name is different from_doc
#35790_doc
#35790 (allow typeless APIs when an index has a custom type) to 6.7. @jpountz Add aninclude_type_name
option to 6.x. (#29453) #37147Phase Two: Important Clean-up. These tasks should be in by 6.7/ 7.0, but can go in after feature freeze.
removal_of_types.asciidoc
to reflect the new plan. @jtibshirani Update 'removal of types' docs to reflect the new plan for 7.0. #38003include_type_name=true
) in documentation. @cbuescher Removeinclude_type_name
in asciidoc where possible #37568 Remove more include_type_name and types from docs #37601 Remove remaining occurances of "include_type_name=true" in docs #37646Phase Three: Additional Deprecations. These are good to have by 6.7/ 7.0, but could be pushed into 7.1 if strictly necessary.
_type
in the search request body._type
as a field name (inmatch
queries, etc.) @mayya-sharipova Deprecate uses of _type as a field name in queries #36503 Avoid duplicate types deprecation messages in search-related APIs. #36802retrieving fieldsLoading_type
as a field doesn't actually work, and doesn't make much sense because each search hit already contains a_type
component.Emit a deprecation warning when a search template containing a type is triggered. Note this is different from emitting a warning when a typed template is originally added.Already covered by other search-related PRs.Emit a deprecation warning when an index template containing a type is triggered. Note this is different from emitting a warning when a typed template is originally added.We support making typeless calls against an index with a custom type, so it is not really harmful to have a template with a custom type (and in fact several internal templates around monitoring use typed templates)._type
in scripts. @jdconrad Deprecate _type from LeafDocLookup #37491 Add types deprecation to script contexts #37554_type
in simulate pipeline requests #37949_graph/explore
calls. #40466)Items we’re still following-up on
_doc
regardless of the underlying type even when the old typed APIs are used?The text was updated successfully, but these errors were encountered: