bunny
bunny

Reputation: 89

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.

Upvotes: 4

Views: 3870

Answers (1)

Alcanzar
Alcanzar

Reputation: 17155

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"));

Upvotes: 8

Related Questions