Permalink
Browse files

use to_i when subtracting from page too

  • Loading branch information...
1 parent a25a3a1 commit 1780478bde3f54ee0bffc1857fdfa4d9bc652050 @grantr grantr committed Jul 23, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/elasticsearch/client/index.rb
@@ -62,7 +62,7 @@ def search(query, options={})
search_options[:size] ||= search_options[:per_page] if search_options[:per_page]
search_options[:size] ||= search_options[:limit] if search_options[:limit]
- search_options[:from] ||= search_options[:size] * (search_options[:page]-1) if search_options[:page] && search_options[:page].to_i > 1
+ search_options[:from] ||= search_options[:size] * (search_options[:page].to_i-1) if search_options[:page] && search_options[:page].to_i > 1
search_options[:from] ||= search_options[:offset] if search_options[:offset]
search_options[:fields] = "_id" if options[:ids_only]

0 comments on commit 1780478

Please sign in to comment.