How to open / close node index using Elasticsearch

curl -XPOST 'localhost:9200/test/_open'
curl -XPOST 'localhost:9200/test/_close'

How to achieve this using Java API?
I have a lot of Googled, but have not found any solution.

+4
source share
1 answer

Playing in eclipse, it looks like it should be something like this:

client.admin().indices().close(new CloseIndexRequest("test"));
client.admin().indices().open(new OpenIndexRequest("test"));
+7
source

Source: https://habr.com/ru/post/1542470/


All Articles