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

  • Home
  • SEARCH
  • 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 5842199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:59:11+00:00 2026-05-22T11:59:11+00:00

We are using sunspot for search in our latest project. We also use devise

  • 0

We are using sunspot for search in our latest project. We also use devise and are indexing our user model as follows:

searchable do
  text :fname
  text :lname
  text :email
  text :description
  text :twitter_username
end

With this setup, a user cannot even log in unless solr is running. This implies that on every save of the User model, there is some communication to our solr server (reindexing?), even if none of the searchable fields have changed. Is this correct?

We also have lots of other models which are being indexed by sunspot which have non-searchable fields that are updated frequently. It appears as though sunspot is reindexing them on all of these updates.

Is there way to configure sunspot to only interface with solr when a searchable field changes?

  • 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-22T11:59:12+00:00Added an answer on May 22, 2026 at 11:59 am

    I’ll assume you have the latest version of sunspot gem.

    1. Sunspot reindexes each time the model has changed. To tweak this behaviour (see options for searchable):

      searchable :ignore_attribute_changes_of => [ :average_rating, :permalink ] do
      text :title
      end

      Take a look on the source code: https://github.com/outoftime/sunspot/blob/master/sunspot_rails/lib/sunspot/rails/searchable.rb

    2. Your site should still work until the first request to solr:

      • either a full text search request

      • either an indexing request

      You are probably making an update on the user model each time a user logs in, therefore triggering a reindex.

    More tips:

    • in fact, it’s not the indexing that takes a lot of time, it’s the commit command; the commit command is issued, by default, on the end of each web request ; This is very costly in a production env. I advice you to change the policy to autocommit after X seconds;

    • if you want that your want to patch sunspot so that you site should work in case of solr server failure, I advise you to take a look on this gem, that mocks server interface for the test env: sunspot_matchers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Sunspot to search for events (parties, concerts, ...) in a Ruby
I'm using Solr and Solr:Cell plugin to index and search rich text documents and
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using JDeveloper , I started developing a set of web pages for a project
Using C#, I need a class called User that has a username, password, active
I'm using sunspot . How can I run a LIKE query ( LIKE %q%
Hello I am using sunspot for searching: when I say: keywords 'India -mountain' do
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using online interfaces to a version control system is a nice way to have
Using ASP.NET MVC there are situations (such as form submission) that may require a

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.