Paginate your search. This works the same way as WillPaginate’s paginate().
Note that Solr searches are always paginated. Not calling paginate is the equivalent of calling:
paginate(:page => 1, :per_page => Sunspot.config.pagination.default_per_page)
The requested page. The default is 1.
How many results to return per page. The default is the value in
Sunspot.config.pagination.default_per_page
Applies a shift to paginated records. The default is 0.
Cursor value for cursor-based pagination. The default is nil.
# File lib/sunspot/dsl/paginatable.rb, line 25 def paginate(options = {}) page = options.delete(:page) per_page = options.delete(:per_page) offset = options.delete(:offset) cursor = options.delete(:cursor) raise ArgumentError, "unknown argument #{options.keys.first.inspect} passed to paginate" unless options.empty? @query.paginate(page, per_page, offset, cursor) end