-
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
Support 'include_type_name' in RestGetIndicesAction #37149
Support 'include_type_name' in RestGetIndicesAction #37149
Conversation
This change adds support for the 'include_type_name' parameter for the indices.get API. This parameter, which defaults to `false` starting in 7.0, changes the response to not include the indices type names any longer. If the parameter is set in the request, we additionally emit a deprecation warning since using the parameter should be only temporarily necessary while adapting to the new response format and we will remove it with the next major version.
Pinging @elastic/es-search |
@@ -52,6 +52,35 @@ setup: | |||
- is_true: test_index.settings | |||
- is_true: test_index.mappings | |||
|
|||
--- | |||
"Test include_type_name": | |||
- skip: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this can be removed after the parameter support has been backported to 6.x
I started referring to this parameter name from various places in elastic#37149 so I think it's a good idea to simplify things by referring to a common constant.
8f3cb9b
to
7ebb0cb
Compare
7ebb0cb
to
4a07eed
Compare
@elasticmachine run the gradle build tests 1 |
I started referring to this parameter name from various places in #37149 so I think it's a good idea to simplify things by referring to a common constant.
@elasticmachine run the gradle build tests 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cbuescher, this looks like it's on a good track. My main questions are around the Java HLRC:
- I had assumed we would flatten
GetIndexResponse#mappings
to be of typeImmutableOpenMap<String, MappingMetaData>
, to avoid nesting the mappings under the_doc
key. - When we backport to 6.x, are we planning to add note under 'breaking changes', and also a 'breaking' label to the PR? My understanding from reading this PR is that for the Java HLRC we will force
include_type_name = false
.
Finally, maybe a Java HLRC expert could take a look to make sure this breaking approach is okay.
server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java
Outdated
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java
Outdated
Show resolved
Hide resolved
If we want to do this, I would only do it in the getter in GetIndexResponse, but leave the internal Changing the Java-API of GetIndexResponse however would be breaking, at least in 7.0. I wouldn't backport this change to 6.x. It would also mean ppl. would be able to get at the "old" type names via the REST API but not e.g. using the old transport client, which might be considered odd. |
So far I thought we could make the 6.x HLRC client force |
92c6e86
to
296f2bc
Compare
@jtibshirani thanks for the review, I pushed a round of changes and tried to respond to your two questions above. Let me know if these answers make sense or you have objections. If we cannot decide on the |
rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments, it looks very close! Sounds good about revisiting the mappings
HLRC change later. It would be good to have a high-bandwidth discussion about this in person.
...c/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponseTests.java
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/action/admin/indices/get/GetIndexResponseTests.java
Outdated
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments for your consideration, but they are minor and I don't think need another round of review.
@jtibshirani thanks for the last round of review and the thumbs up, I pushed another commit adressing you last comments. Waiting for green CI now before I merge. |
server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesActionTests.java
Show resolved
Hide resolved
@elasticmachine run default distro tests |
This change adds support for the 'include_type_name' parameter for the indices.get API. This parameter, which defaults to `false` starting in 7.0, changes the response to not include the indices type names any longer. If the parameter is set in the request, we additionally emit a deprecation warning since using the parameter should be only temporarily necessary while adapting to the new response format and we will remove it with the next major version.
This change adds support for the 'include_type_name' parameter for the
indices.get API. This parameter, which defaults to
false
starting in 7.0,changes the response to not include the indices type names any longer.
If the parameter is set in the request, we additionally emit a deprecation
warning since using the parameter should be only temporarily necessary while
adapting to the new response format and we will remove it with the next major
version.