Search in sources :

Example 1 with DeleteIndex

use of io.searchbox.indices.DeleteIndex in project herd by FINRAOS.

the class IndexFunctionsDaoImpl method deleteIndex.

/**
 * The delete index function will take as an argument the index name and will delete the index.
 */
@Override
public final void deleteIndex(String indexName) {
    Action action = new DeleteIndex.Builder(indexName).build();
    LOGGER.info("Deleting Elasticsearch index, indexName={}.", indexName);
    JestResult result = jestClientHelper.executeAction(action);
    LOGGER.info("Deleting Elasticsearch index, indexName={}. result successful is {} ", indexName, result.isSucceeded());
}
Also used : SearchAction(org.elasticsearch.action.search.SearchAction) Action(io.searchbox.action.Action) BulkableAction(io.searchbox.action.BulkableAction) DeleteIndex(io.searchbox.indices.DeleteIndex) JestResult(io.searchbox.client.JestResult)

Example 2 with DeleteIndex

use of io.searchbox.indices.DeleteIndex in project dq-easy-cloud by dq-open-cloud.

the class TransportClient method deleteIndexAll.

/**
 * 将删除所有的索引
 *
 * @throws Exception
 */
@Test
public void deleteIndexAll() throws Exception {
    DeleteIndex deleteIndex = new DeleteIndex.Builder("article").build();
    JestResult result = jestClient.execute(deleteIndex);
    System.out.println(result.getJsonString());
}
Also used : DeleteIndex(io.searchbox.indices.DeleteIndex) JestResult(io.searchbox.client.JestResult) Test(org.junit.Test)

Aggregations

JestResult (io.searchbox.client.JestResult)2 DeleteIndex (io.searchbox.indices.DeleteIndex)2 Action (io.searchbox.action.Action)1 BulkableAction (io.searchbox.action.BulkableAction)1 SearchAction (org.elasticsearch.action.search.SearchAction)1 Test (org.junit.Test)1