如何从弹性搜索中获得所有结果,因为结果仅显示限制为10.我有一个像这样的查询:
@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
Run Code Online (Sandbox Code Playgroud)
我已将限制设置为15,但我不想让它无限制,以便我可以获得所有数据,我无法设置限制,因为我的数据不断变化,我想获得所有数据.
我需要从一个数组中找到最大值,该数组的元素是一个数组,由两个元素组成,第一个是表示时间的字符串,第二个是整数.我想要数组的第二个元素中的最大值和最小值.
a = [
["2015-04-01 20:51:03 +0530", 7],
["2015-04-01 20:51:03 +0530", 11],
["2015-04-01 20:51:03 +0530", 8],
["2015-04-01 20:51:03 +0530", 8],
["2015-04-01 20:51:03 +0530", 8],
["2015-04-01 20:51:03 +0530", 8],
["2015-04-01 20:51:05 +0530", 8],
["2015-04-01 20:51:05 +0530", 20],
["2015-04-01 20:51:05 +0530", 0],
["2015-04-01 20:51:05 +0530", 2],
["2015-04-01 20:51:05 +0530", 1],
["2015-04-01 20:51:05 +0530", 9]
]
Run Code Online (Sandbox Code Playgroud)
知道最好的方法是做什么的吗?