Use optype CREATE for single auto-id index requests#47353
Merged
ywelsch merged 4 commits intoelastic:masterfrom Oct 2, 2019
Merged
Use optype CREATE for single auto-id index requests#47353ywelsch merged 4 commits intoelastic:masterfrom
ywelsch merged 4 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/es-distributed |
Contributor
Author
|
@elasticmachine run elasticsearch-ci/1 |
…for-auto-id-requests
henningandersen
approved these changes
Oct 1, 2019
| @Override | ||
| public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient client) throws IOException { | ||
| assert request.params().get("id") == null : "non-null id: " + request.params().get("id"); | ||
| if (request.params().get("op_type") == null && clusterService.state().nodes().getMinNodeVersion().onOrAfter(Version.CURRENT)) { |
Contributor
There was a problem hiding this comment.
The rest-api-spec (index.json) says default for op_type is index, I think we should change that to be create.
I wonder if we should have an end-goal of removing op_type support here as a breaking change in 8.0?
Contributor
Author
There was a problem hiding this comment.
The problem is that this API spec mixes auto-id which non-auto-id. In one case, the default op_type is create, in the other case it is index. I have moved the explanation of the default into the description (as we have for many other parameters).
…for-auto-id-requests
ywelsch
added a commit
to ywelsch/elasticsearch
that referenced
this pull request
Oct 2, 2019
Changes auto-id index requests to use optype CREATE, making it compliant with our docs. This will also make these auto-id index requests compatible with the new "create-doc" index privilege (which is based on the optype), the default optype is changed to create, just as it is already documented.
ywelsch
added a commit
that referenced
this pull request
Oct 2, 2019
Changes auto-id index requests to use optype CREATE, making it compliant with our docs. This will also make these auto-id index requests compatible with the new "create-doc" index privilege (which is based on the optype), the default optype is changed to create, just as it is already documented.
ywelsch
added a commit
that referenced
this pull request
Oct 2, 2019
ywelsch
added a commit
that referenced
this pull request
Oct 2, 2019
24 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes auto-id index requests to use optype CREATE. According to our docs (https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#_create_document_ids_automatically):
This is unfortunately not true, as we are currently using
indexas default optype. To make these auto-id index requests compatible with the new "create-doc" index privilege (which is based on the optype), the default optype is changed to create, just as it is already documented.