srb.addField("_id");
srb.addField("timestamp");
srb.addField("_source");
final SearchRequest request = srb.request();
final SearchResponse response = client.search(request).actionGet();
if (! commandLineOptions.isFix()) {
LOG.warn("Not executing update because '-F' command line flag not given!");
}
while (true) {
final SearchResponse r = client.prepareSearchScroll(response.getScrollId()).setScroll(TimeValue.timeValueMinutes(1)).execute().actionGet();
if (r.getHits().getHits().length == 0) {
LOG.debug("No more hits, done!");
break;
}
final BulkRequestBuilder bulk = client.prepareBulk();
for (SearchHit hit : r.getHits()) {
processedCount++;
try {
if (handleHit(hit, bulk)) {
changedCount++;
}