-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Remove CreateIndexRequest.addMapping(type, string, xcontenttype) #50419
Remove CreateIndexRequest.addMapping(type, string, xcontenttype) #50419
Conversation
Pinging @elastic/es-distributed (:Distributed/CRUD) |
@elasticmachine update branch |
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.
LGTM
String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("type1") | ||
.startObject("properties").startObject("appAccountIds").field("type", "text").endObject().endObject() | ||
String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject() | ||
.startObject("properties").startObject("appAccountIds").field("type", "text").endObject() |
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 try to re-indent these when I see them to make them a bit more readable.
@elasticmachine update branch |
…stic#50419) We still have a number of places, mainly in test code but some in production, that are building mappings with a named type as the root of a map. CreateIndexRequest handles this automatically, but PutMappingRequest does not, which is a bit trappy - we can get situations like elastic#50359 where the same mapping will work when an index is created but fail on an update. This commit is a first step to removing the leniency in CreateIndexRequest so that we can catch mappings with a named type root earlier. Relates to elastic#41059
…Builder)` (elastic#50586) This continues the removal of type parameters from CreateIndexRequest.mapping methods started in elastic#50419. Here the removed methods are almost entirely in test code, with the exception of a change to TransformIndex in the transform plugin. Relates to elastic#41059
We still have a number of places, mainly in test code but some in production, that
are building mappings with a named type as the root of a map. CreateIndexRequest
handles this automatically, but PutMappingRequest does not, which is a bit trappy -
we can get situations like #50359 where the same mapping will work when an
index is created but fail on an update.
This commit is a first step to removing the leniency in CreateIndexRequest so that
we can catch mappings with a named type root earlier.
Relates to #41059