Elasticsearch - SearchHit

How I can establish more then 10 hits (SearchHit) in SearchResponse? By default I have only 10 hits and can't get more.
When I do searchResponse.getHits(), I get only 10 hits.

You can change the from and size parameters to navigate in the results.

See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html

from and size is definitely the way to go. If you need to iterate over the results, you may also want to look at the _scroll functions.

Thanks, it helps.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.