curl -XPOST 'localhost:9200/test/_open'
curl -XPOST 'localhost:9200/test/_close'
如何使用 Java API 实现这一点?
我用谷歌搜索了很多但没有找到任何解决方案。
最佳答案
在eclipse里面玩了一圈,貌似应该是这样的:
client.admin().indices().close(new CloseIndexRequest("test"));
client.admin().indices().open(new OpenIndexRequest("test"));
关于java - 如何使用 Elasticsearch 打开/关闭节点的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23932483/