Thank you! Your feedback has been delivered
Thank you! Your feedback has been sent

multi_match query in ElasticSearch returns only 10 hits

I got a total of 96 matches but the hits object contains only the first 10 hits. How can I get the rest of the hits? Do I need to make another call with an offset?

{ took: 39, timed_out: false, _shards: { total: 5, successful: 5, failed: 0 }, hits: { total: 96, max_score: 0.53432184, hits: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object] ] } }

User Gravatar

enadav

Posted Oct 8 2013 19:00 UTC

$10


  • Assigned To moliware
  • Solved
  • elasticsearch
  • 1436 Views

1 Replies


You have to use the "pagination concept". You have to add your query the parameters "from" y "size". Size is the number of results you want to receive and from is the offset.

Example:

{ "from" : 0, "size" : 20, "query" : { "match_all" : { } } }

If you want to retrieve lots of results you should use scroll

User Gravatar

moliware

Posted Oct 9 2013 2:31 UTC

Solution

This didn't solve your task? Get your own custom solution.

Add a reply

By posting a reply on CodersClan you agree to our Terms & Conditions