Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open/close index of a node with Elasticsearch

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

How to achieve this with the Java API?
I have Googled lot but didn't find any solution.

like image 220
bunny Avatar asked Mar 19 '23 11:03

bunny


1 Answers

Playing around 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"));
like image 97
Alcanzar Avatar answered Mar 22 '23 00:03

Alcanzar