How to get all results back from search?
See original GitHub issueAfter executing a search, the Search hits.total
is over 9000. However, when I check the length of hits.hits
it is only 10:
>>> client = Elasticsearch(['http://nightly.apinf.io:14002'])
>>> search = Search(using=client)
>>> results = search.execute()
>>> results.hits.total
9611
>>> len(results.hits.hits)
10
How do I get back all 9611 search results?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:20 (6 by maintainers)
Top Results From Across the Web
elasticsearch - How to get all the values from an search result
I am new to Elastic Search. Is there any way to get all the search results for a search keyword? Elastic Search is...
Read more >How do I make search return results that actually contain ...
I get results containing the word "search" and a few of them even contain the word "words", but I can't see any that...
Read more >SharePoint Search – how to return all results
This can be done by keeping the current row index value(which is the last row of the current result set), looping through the...
Read more >How do I get all results from large requests to the Search ...
I'm trying to request day-by-day metrics for a large number of pages via the Search Console API. When trying to do this in...
Read more >How to Get More Google Search Results Per Page - YouTube
How to Get More Google Search Results Per Page.Google puts all the information in the world literally at the tips of your fingers....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@abhimanyu3 sorry for the late response, by default the
scan
return things unordered. To have it respect the sort you need to dos = s.params(preserve_order=True)
before callings.scan()
(see [0] for details).0 - https://elasticsearch-py.readthedocs.io/en/master/helpers.html#scan
Also, if you want to retrieve all the hits, there is a specialized method called
scan
that will iterate over all the hits, not just the top N. That is the recommended way if you want to unload all of the documents above lets say a few hundred or thousand.