How can I get the status of a Index in elasticsearch in java

I try to find a Java api, of cause the High-level one, to get the status of a index. It can be done in kibana console with single GET /index/_stats. However, it is so hard to find one single relevent api in High-level java api to accomplesh this task. Is there any one trying to seek help like this?

There is no direct api available for the same but you can always use low level client object to make an API request.

Response response = highlevelRestClient.getLowLevelClient()
        .performRequest(new Request("GET", "/index/_stats"));

Using above you proceed with extracting relevant information from response object. I would highly discourage using the above method for api which have direct implementation available in high level rest client.

Thanks a lot for your help.
By the way, do you have any idea why they didn't put this function into high level rest client?

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