final SearchScrollRequest scrollRequest = client.prepareSearchScroll(searchResponse.getScrollId())
.setScroll(scroll)
.request();
final SearchResponse scrollResponse = client.searchScroll(scrollRequest).actionGet();
final BulkRequestBuilder bulkRequestBuilder = client.prepareBulk();
<BUG>for(SearchHit hit : scrollResponse.getHits().hits()) {
</BUG>
final DeleteRequest deleteRequest = client.prepareDelete(hit.index(), hit.type(), hit.id()).request();
bulkRequestBuilder.add(deleteRequest);
}

final SearchScrollRequest scrollRequest = client.prepareSearchScroll(searchResponse.getScrollId())
.setScroll(scroll)
.request();
final SearchResponse scrollResponse = client.searchScroll(scrollRequest).actionGet();
final BulkRequestBuilder bulkRequestBuilder = client.prepareBulk();
for (SearchHit hit : scrollResponse.getHits().hits()) {
final DeleteRequest deleteRequest = client.prepareDelete(hit.index(), hit.type(), hit.id()).request();
bulkRequestBuilder.add(deleteRequest);
}
