0

I'm using sunspot_rails '~> 2.2' (Solr 5.3.1 1703449). When I create/update models I cannot find new changes and Solr admin panel for the target core doesn't show changes in Last Modified. But if I restart Solr directly I will be able to find by new changes and field Last Modified will also change.

How to fix it?

Alexander Shlenchack
  • 3,779
  • 6
  • 32
  • 46

1 Answers1

0

From the readme:

If you make a change to the object's "schema" (code in the searchable block), you must reindex all objects so the changes are reflected in Solr:

bundle exec rake sunspot:solr:reindex

Also, according to this and this, Sunspot.commit which updates the Solr index is not automatically called if you're updating a model outside of a Rails request (for example, from the Rails console). You can manually call Sunspot.commit from the console to commit the changes to Solr.

Exectuting bundle exec rake sunspot:solr:reindex will also commit your changes.

Community
  • 1
  • 1
p4sh4
  • 3,292
  • 1
  • 20
  • 33
  • I do not change a schema. I figure out that my target Solr core not reloading. But for now I don't understand why. – Alexander Shlenchack Oct 30 '15 at 10:09
  • When you say "create/update searchable models", you mean "create/update searchable models in the database", for example through your app's UI? – p4sh4 Oct 30 '15 at 10:11