Does the java new client support _doc api?

Hello, we are migrating from the Java Rest High Level Client to the New Rest Client.
Currently, the java new rest client seems to support document create EndPoint only with _create.
I'm going to use _doc Endpoint to automatically specify the id of the document, but is there any way to create a document through that endpoint now or is there any additional plan in the fucure?

here is code sample
OK

CreateRequest createRequest = new CreateRequest.Builder<T>()
					.index(targetIndex)
					.id(indexId)
					.document(document)
					.build();
client.create(createRequest);

Endpoint is _create Failed

CreateRequest createRequest = new CreateRequest.Builder<T>()
					.index(targetIndex)
					.document(document)
					.build();
client.create(createRequest);

Hey,

I am not sure what you mean with _doc endpoint. Can you clarify? If you do not want to create an ID, you can go with the IndexRequest instead, that generates an ID. Would that work for you?

If you think this feature should be added, please create an issue in GitHub - elastic/elasticsearch-java: Official Elasticsearch Java Client

--Alex

Thank you for your answer.
I thought IndexRequest was a class that only manages simple indexes.
I solved it in that way. Thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.