scanThis(any, QueryBuilders.matchAllQuery(), keepTimeInMinutes, pageSize);
}
public void scanThis(AnyExecutor<T> any, QueryBuilder query,
long keepTimeInMinutes, int pageSize) {
SearchRequestBuilder srb = client.prepareSearch(getIndexName()).
setQuery(query).setSize(pageSize).
setSearchType(SearchType.SCAN).
setScroll(TimeValue.timeValueMinutes(keepTimeInMinutes));
SearchResponse rsp = srb.execute().actionGet();
try {
int counter = 0;
while (true) {
rsp = client.prepareSearchScroll(rsp.scrollId()).