Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7169157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:55:45+00:00 2026-05-28T14:55:45+00:00

I recently decided to port my indexing engine from sphinx to solr. Having used

  • 0

I recently decided to port my indexing engine from sphinx to solr. Having used kaminari with thinking_sphinx I decided to try making use of generic pagination in sunspot https://github.com/sunspot/sunspot/pull/64 / https://github.com/sunspot/sunspot/pull/67, in order to use avoid moving to will_paginate.

My search is handled as follows:

@search = Address.search do
  fulltext params[:search]
  with(:updated_at).greater_than(1.week.ago)
  order_by :updated_at, :desc
  paginate :page => params[:page], :per_page => 7
end

My view is unchanged from what I had when I was using thinking_sphinx:

<%= render :partial => 'address' %>
<%= paginate @addresses %>

My problem is that after the change I continually get the following error when trying to perform a search:

undefined method `current_page' for []:Array

I am using the latest version of sunspot, which to my knowledge should enable me to use kaminari:

Using sunspot (1.3.0.rc3) from git://github.com/sunspot/sunspot.git (at master) 
Using sunspot_rails (1.3.0.rc3) from git://github.com/sunspot/sunspot.git (at master) 

This worked perfectly with my old thinking_sphinx setup, so what am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:55:46+00:00Added an answer on May 28, 2026 at 2:55 pm

    This is how I have used and it works great

    @search = Sunspot.search(Listing) do
          if params[:category].present?
            with :category_id, params[:category]
          end
          if params[:subcategory].present?
            with :subcategory_id, params[:subcategory]
          end
          if params[:q].present?
            keywords params[:q]  do 
              fields :title, :description
            end
          end
          paginate :page => params[:page], :per_page => SEARCH_RESULT_PER_PAGE
        end
    

    And in views I have this

    <%= paginate @search.hits %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently decided to give matplotlib.pyplot a try, while having used gnuplot for scientific
I come from a Java background and recently decided to try creating a C++
I recently decided to use Apache HTTPD (on CentOS - RPM version httpd-2.2.3-45.el5.centos) with
Background info: I've recently decided to take on a project of making a social
i am quite familiar with Smarty and recently decided to use Zend framework in
I recently decided to switch to clang from gcc and I’m getting the following
I've recently decided to try an upgrade to 4.0. The only error I still
My boss decided recently to try out an outsourcing group for increased capacity as
I recently decided to try to learn some bash scripting and as a fun
I recently decided to try some java web development, so I installed xampp, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.