有人可以帮我找到相应的API参考资料,以便将这些API更新为Rest而不是transportClient吗?
String[] indices = transportClient.admin()
.indices()
.prepareGetIndex()
.addIndices("_" + tid + "-")
.execute()
.actionGet()
.getIndices();
transportClient.admin()
.indices()
.prepareFlush(indexName)
.get();
transportClient.admin()
.indices()
.prepareRefresh(indexName)
.get();
transportClient.admin()
.cluster()
.state(clusterStateRequest)
.actionGet()
.getState()
.getMetaData()
.index(indexName)
.getAliases();
答案 0 :(得分:0)
如果你想使用RestHighLevelClient
,你只需要改变你的
TransportClient
RestClient
就像这样
RestHighLevelClient client = new RestHighLevelClient(
RestClient.builder(
new HttpHost("localhost", 9200, "http"),
new HttpHost("localhost", 9201, "http")));
编辑:关于FLUSH / REFRESH和CLUSTER_STATE,此功能将在下一个版本中提供......
(在6.3.0上)刷新 - > https://github.com/elastic/elasticsearch/pull/27799(在6.3.0上)Flush - > https://github.com/elastic/elasticsearch/pull/28852群集状态 - >没开始