mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-24 17:09:48 +00:00
Docs: Some Data Cant't be obtained.
In previous case, the first 100 data can't be obtained. Closes #8103
This commit is contained in:
parent
0fb81d6643
commit
940534299d
@ -62,10 +62,11 @@ SearchResponse scrollResp = client.prepareSearch(test)
|
||||
.setSize(100).execute().actionGet(); //100 hits per shard will be returned for each scroll
|
||||
//Scroll until no hits are returned
|
||||
while (true) {
|
||||
scrollResp = client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(new TimeValue(600000)).execute().actionGet();
|
||||
|
||||
for (SearchHit hit : scrollResp.getHits()) {
|
||||
//Handle the hit...
|
||||
}
|
||||
scrollResp = client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(new TimeValue(600000)).execute().actionGet();
|
||||
//Break condition: No hits are returned
|
||||
if (scrollResp.getHits().getHits().length == 0) {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user