SearchResponse search = client().prepareSearch().setQuery(QueryBuilders.matchAllQuery()).execute().actionGet();
assertThat(search.getHits().totalHits(), equalTo(iters));
DeleteByQueryRequestBuilder deleteByQueryRequestBuilder = client().prepareDeleteByQuery();
deleteByQueryRequestBuilder.setQuery(QueryBuilders.matchAllQuery());
DeleteByQueryResponse actionGet = deleteByQueryRequestBuilder.execute().actionGet();
assertThat(actionGet.status(), equalTo(RestStatus.OK));
assertThat(actionGet.getIndex("twitter"), notNullValue());
assertThat(actionGet.getIndex("twitter").getFailedShards(), equalTo(0));
client().admin().indices().prepareRefresh().execute().actionGet();