How to make Point InTime API request of Elasticsearch using JAVA High Level REST client

Viewed 900

It will be helpful if someone can point me to a way to execute Point In Time API request, which is newly introduced in Elasticsearch 7.10.1, from JAVA using REST high-level client or any other way in JAVA. (except Transport client as it is going to be deprecated soon)

1 Answers

Low level rest client comes to rescue when high level rest client doesn't have a wrapper for any api. You can use low level client via high level client as below:

String endPoint = "my-index-000001/_pit";
Request request = new Request("POST", endPoint);
request.addParameter("keep_alive", "1m");
Response response = highLevelClient.getLowLevelClient().performRequest(request);

Then use the response object to extract out the relevant information.

Related