elasticsearch spring data低级请求

自定义request

Request request = new Request(HttpMethod.GET.toString(), "/_cat/indices");
request.addParameter("bytes", "b");
request.addParameter("format", "json");
Map<String, Long> map = new HashMap<>(4);

try {
	Response response = restHighLevelClient.getLowLevelClient().performRequest(request);

	System.out.println(response);
	HttpEntity entity = response.getEntity();
	InputStream content = entity.getContent();
	String res = EntityUtils.toString(response.getEntity());
	System.out.println(res);
}
catch (Exception e) {

}
posted @ 2021-09-09 21:13  fight139  阅读(57)  评论(0编辑  收藏  举报