A getHits() was forgotten!

This commit is contained in:
eBuildy 2015-01-15 19:01:52 +01:00
parent 3f4a33c8f1
commit 11b30536d3

View file

@ -63,7 +63,7 @@ SearchResponse scrollResp = client.prepareSearch(test)
//Scroll until no hits are returned //Scroll until no hits are returned
while (true) { while (true) {
for (SearchHit hit : scrollResp.getHits()) { for (SearchHit hit : scrollResp.getHits().getHits()) {
//Handle the hit... //Handle the hit...
} }
scrollResp = client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(new TimeValue(600000)).execute().actionGet(); scrollResp = client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(new TimeValue(600000)).execute().actionGet();