Types removal - deprecate include_type_name with index templates#37484
Types removal - deprecate include_type_name with index templates#37484markharwood merged 16 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-search |
320d119 to
25dee4d
Compare
|
@elasticmachine run elasticsearch-ci-2 |
4583d6b to
9e6fe7f
Compare
19d1e4b to
69469cb
Compare
909fb6d to
48ab11f
Compare
|
|
jtibshirani
left a comment
There was a problem hiding this comment.
Thanks @markharwood for this work, it is definitely one of the most tricky APIs in the whole group!
I added a few minor suggestions, and also had an overall comment: instead of modifying the server-side request, I I think we should create a new client-side PutIndexTemplateRequest, as we've discussed doing for all the APIs that take include_type_name. This will give better predictability for users, as it will match what we did for put mapping (#37280) and create index (#37134). It also gives a nicer API, since we can start with a fresh object and use method names like source as opposed to untypedSource. Maybe we could even name the new method putIndexTemplate for parity with the new getIndexTemplate?
Currently discussing with @hub-cap how we can employ an "interim" name that will pass naming checks until we have passed a deprecation cycle and can adopt the new name.
Assuming that RestHighLevelClientTests#testApiNamingConventions is test that is failing, could we just add "indices.get_index_template" for now to the list of exceptions here "https://github.com/elastic/elasticsearch/blob/master/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java#L764-L776 ?
client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesClient.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesClient.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java
Outdated
Show resolved
Hide resolved
...nt/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetaData.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java
Outdated
Show resolved
Hide resolved
b135f0b to
1082aa2
Compare
I can do that but my concerns would be:
Are any of these news to you?
Done and agreed with Baz. |
|
Right, from our discussions we've agreed that the benefits of creating new requests + responses outweigh the downsides. Some specific thoughts:
Yes, we are unfortunately creating a bit of duplicate code (as we have been doing in many other places for the HLRC). Longer term, I think @hub-cap is working to mitigate this through an approach where we generating requests + responses.
I think this is a relatively short-lived double standard, and only affects internal teams/ users of the deprecated transport client. We'll begin working to remove types from the
I've been planning to submit an issue to track + hopefully fix the bug you found in the server requests. I don't really see this point as being related to whether we should create new client classes (and in fact using a new client request may make it simpler to address the bug?) |
|
OK. So we'll deprecate the existing putTemplate with the existing server-side PITR and add a new |
|
It might be helpful to take a look at the 'put mapping' PR to see the recommended approach (#37280). In the same way that we are accepting both |
Validate null template name in constructor. Use server side’s GetIndexTemplateResponse class to create XContent for client-side counterpart’s fromXContent test.
1a1d3e0 to
aebbc9b
Compare
* master: (29 commits) Fix limit on retaining sequence number (elastic#37992) Docs test fix, wait for shards active. Revert "Revert "Documented default values for index follow request parameters. (elastic#37917)"" Revert "Documented default values for index follow request parameters. (elastic#37917)" Ensure date parsing BWC compatibility (elastic#37929) SQL: Skip the nested and object field types in case of an ODBC request (elastic#37948) Use mappings to format doc-value fields by default. (elastic#30831) Give precedence to index creation when mixing typed templates with typeless index creation and vice-versa. (elastic#37871) Add classifier to tar.gz in docker compose (elastic#38011) Documented default values for index follow request parameters. (elastic#37917) Fix fetch source option in expand search phase (elastic#37908) Restore a noop _all metadata field for 6x indices (elastic#37808) Added ccr to xpack usage infrastructure (elastic#37256) Fix exit code for Security CLI tools (elastic#37956) Streamline S3 Repository- and Client-Settings (elastic#37393) Add version 6.6.1 (elastic#37975) Ensure task metadata not null in follow test (elastic#37993) Docs fix - missing callout Types removal - deprecate include_type_name with index templates (elastic#37484) Handle completion suggestion without contexts ...
…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
|
@markharwood this was reverted in #38427 because it was failing bwc tests on master |
…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
No description provided.