橡皮、老虎皮、狮子皮哪一个最不好?

更换最新es客户端RestHighLevelClient后

Elasticsearch | 作者 lvwendong | 发布于2018年12月19日 | 阅读数:6918

更换最新es客户端RestHighLevelClient后,

IndicesStatsResponse response = client.admin().indices().prepareStats("index1").all().execute().actionGet();
如何替换为最新的代码
已邀请:

rochy - rochy_he

赞同来自: lvwendong

新版 API 里面,你可以看下 Cluster API,感觉应该可用:
https://www.elastic.co/guide/e ... dices
 
还有一种方案就是自己使用 RestLowLevelClient 自己请求相关地址,
关于获取 index Stats 的可参考:https://www.elastic.co/guide/e ... .html
 
 

God_lockin

赞同来自: lvwendong

restHighLevelClient.index(new IndexRequest().index("index"), RequestOptions.DEFAULT.toBuilder().build()).status()
这个是你想要的东西吗?

要回复问题请先登录注册