Reputation: 981
I am new to Elastic Search. Is there any way to get all the search results for a search keyword? Elastic Search is limited to 10 or else we can set the size but we need to get the size??
Upvotes: 9
Views: 13199
Reputation: 12347
You can do this in couple of steps using some code
1000
and get all 1000 records.hits.total
whether size is smaller than 1000. (if small then you got all the records :) )1001
in from and total
as size from previous query to get full result.Upvotes: 0
Reputation: 721
If you use the JAVA API you can simple get the total hit number from the SearchResponse
SearchRequestBuilder srb = ..
SearchResponse sr = srb.execute().actionGet();
long totalHits = sr.getHits().getTotalHits();
Upvotes: 4
Reputation: 403451
Yes, the default number of search results is 10.
You need to set the size
parameter on the query.
I don't think you an say "all results", though, there must always be a size limit.
Upvotes: 16