String host = locationSocket[0];
String port = locationSocket.length > 1 ? locationSocket[1] : "9300";
client.addTransportAddress(new InetSocketTransportAddress(host, Integer.parseInt(port)));
}
LOGGER.info("index %s exists?", indexName);
IndicesExistsRequest existsRequest = client.admin().indices().prepareExists(indexName).request();
if (client.admin().indices().exists(existsRequest).actionGet().isExists()) {
LOGGER.info("index %s exists... deleting!", indexName);
DeleteIndexResponse response = client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet();
if (!response.isAcknowledged()) {
LOGGER.error("Failed to delete elastic search index named %s", indexName);