module Elasticsearch::FacetedSearch::Pagination
Public Instance Methods
current_page()
click to toggle source
# File lib/elasticsearch/faceted_search/pagination.rb, line 22 def current_page (search_params[:page] ||= 1).to_i end
limit()
click to toggle source
# File lib/elasticsearch/faceted_search/pagination.rb, line 18 def limit (search_params[:limit] ||= 32).to_i end
limit_value()
click to toggle source
# File lib/elasticsearch/faceted_search/pagination.rb, line 14 def limit_value limit end
total_count()
click to toggle source
# File lib/elasticsearch/faceted_search/pagination.rb, line 4 def total_count search['hits']['total'].to_i rescue 0 end
total_pages()
click to toggle source
# File lib/elasticsearch/faceted_search/pagination.rb, line 10 def total_pages (total_count.to_f / limit_value.to_f).ceil end