Elasticsearch - SearchHit

(Nikita Krasnov) #1

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.

(David Pilato) #2

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

(Scott Carr) #3

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.

(Nikita Krasnov) #4

Thanks, it helps.

(system) #5

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