Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Elastic search limit to "unlimited"

How can i get all the results from elastic search as the results only display limit to 10 only. ihave got a query like:

@data = Athlete.search :load => true do           size 15           query do             boolean do               must { string q, {:fields => ["name", "other_names", "nickname", "short_name"], :phrase_slop => 5} }               unless conditions.blank?                 conditions.each do |condition|                   must { eval(condition) }                 end               end               unless excludes.blank?                 excludes.each do |exclude|                   must_not { eval(exclude) }                 end               end             end           end           sort do             by '_score', "desc"           end         end 

i have set the limit to 15 but i wan't to make it unlimited so that i can get all the data I can't set the limit as my data keeps on changing and i want to get all the data.

like image 269
Sumit Rai Avatar asked Jan 18 '13 10:01

Sumit Rai


1 Answers

You can use the from and size parameters to page through all your data. This could be very slow depending on your data and how much is in the index.

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

like image 123
Zach Avatar answered Sep 27 '22 02:09

Zach