use of org.elasticsearch.action.admin.indices.open.OpenIndexResponse in project elasticsearch by elastic.
the class OpenCloseIndexIT method testCloseOpenAll.
public void testCloseOpenAll() {
Client client = client();
createIndex("test1", "test2", "test3");
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("_all").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1", "test2", "test3");
OpenIndexResponse openIndexResponse = client.admin().indices().prepareOpen("_all").execute().actionGet();
assertThat(openIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsOpened("test1", "test2", "test3");
}
use of org.elasticsearch.action.admin.indices.open.OpenIndexResponse in project elasticsearch by elastic.
the class OpenCloseIndexIT method testOpenOneMissingIndexIgnoreMissing.
public void testOpenOneMissingIndexIgnoreMissing() {
Client client = client();
createIndex("test1");
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
OpenIndexResponse openIndexResponse = client.admin().indices().prepareOpen("test1", "test2").setIndicesOptions(IndicesOptions.lenientExpandOpen()).execute().actionGet();
assertThat(openIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsOpened("test1");
}
use of org.elasticsearch.action.admin.indices.open.OpenIndexResponse in project elasticsearch by elastic.
the class OpenCloseIndexIT method testCloseOpenAllWildcard.
public void testCloseOpenAllWildcard() {
Client client = client();
createIndex("test1", "test2", "test3");
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("*").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1", "test2", "test3");
OpenIndexResponse openIndexResponse = client.admin().indices().prepareOpen("*").execute().actionGet();
assertThat(openIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsOpened("test1", "test2", "test3");
}
Aggregations