-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Use optype CREATE for single auto-id index requests #47353
Use optype CREATE for single auto-id index requests #47353
Conversation
Pinging @elastic/es-distributed |
@elasticmachine run elasticsearch-ci/1 |
…for-auto-id-requests
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.
@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)) { |
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.
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?
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.
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
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.
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.
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
index
as 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.