简体   繁体   中英

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

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM