Commit 99e659b09655df6391126110dc5c2af4aef88500

Authored by Andrew Kane
2 parents 52686a4f 2c04eead

Merge branch 'ledermann-fix-default-limit'

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
lib/searchkick/query.rb
@@ -49,7 +49,7 @@ module Searchkick @@ -49,7 +49,7 @@ module Searchkick
49 49
50 # pagination 50 # pagination
51 page = [options[:page].to_i, 1].max 51 page = [options[:page].to_i, 1].max
52 - per_page = (options[:limit] || options[:per_page] || 100_000).to_i 52 + per_page = (options[:limit] || options[:per_page] || 1_000).to_i
53 padding = [options[:padding].to_i, 0].max 53 padding = [options[:padding].to_i, 0].max
54 offset = options[:offset] || (page - 1) * per_page + padding 54 offset = options[:offset] || (page - 1) * per_page + padding
55 55
@@ -300,7 +300,7 @@ module Searchkick @@ -300,7 +300,7 @@ module Searchkick
300 facets.each do |field, facet_options| 300 facets.each do |field, facet_options|
301 # ask for extra facets due to 301 # ask for extra facets due to
302 # https://github.com/elasticsearch/elasticsearch/issues/1305 302 # https://github.com/elasticsearch/elasticsearch/issues/1305
303 - size = facet_options[:limit] ? facet_options[:limit] + 150 : 100_000 303 + size = facet_options[:limit] ? facet_options[:limit] + 150 : 1_000
304 304
305 if facet_options[:ranges] 305 if facet_options[:ranges]
306 payload[:facets][field] = { 306 payload[:facets][field] = {
@@ -350,7 +350,7 @@ module Searchkick @@ -350,7 +350,7 @@ module Searchkick
350 aggs = Hash[aggs.map { |f| [f, {}] }] if aggs.is_a?(Array) # convert to more advanced syntax 350 aggs = Hash[aggs.map { |f| [f, {}] }] if aggs.is_a?(Array) # convert to more advanced syntax
351 351
352 aggs.each do |field, agg_options| 352 aggs.each do |field, agg_options|
353 - size = agg_options[:limit] ? agg_options[:limit] : 100_000 353 + size = agg_options[:limit] ? agg_options[:limit] : 1_000
354 shared_agg_options = agg_options.slice(:order) 354 shared_agg_options = agg_options.slice(:order)
355 355
356 if agg_options[:ranges] 356 if agg_options[:ranges]