// setting up the search for all content
SearchResponse scrollResp = client.prepareSearch(index).setSearchType(SearchType.SCAN).setQuery(QueryBuilders.matchAllQuery())
.setSize(100).setScroll(TimeValue.timeValueMinutes(2)).execute().actionGet();
while (true) {
scrollResp = client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(TimeValue.timeValueMinutes(2)).execute()
.actionGet();
boolean hitsRead = false;
for (SearchHit hit : scrollResp.getHits()) {
bw.write(hit.getId());
bw.write(JSON_RECORD_DELIMITER);