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?
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.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments