My unit/integration tests includes tests for search functionality.
My idea is to have empty search index before each test. So, I\'m trying to remove al
Found solution:
IndicesAdminClient adminClient = searchConnection.client.admin().indices();
String indexName = "location";
DeleteIndexResponse delete = adminClient.delete(new DeleteIndexRequest(indexName)).actionGet()
if (!delete.isAcknowledged()) {
log.error("Index {} wasn't deleted", indexName);
}
and
client.admin().indices().flush(new FlushRequest('location')).actionGet();
after putting new data into index.