Everytime i try to reindex using...
rake sunspot:solr:reindex
These error messages always show:
Error - R
The essence is to reset every sunspot solr part, that may occur problems.
Delete the complete solr
directory. This deletes the complete solr directory for sure - double check!
rm -rf solr
Delete the sunspot solr configuration file config/sunspot.yml
.
rm config/sunspot.yml
Stop sunspot solr.
bundle exec rake sunspot:solr:stop
Check if sunspot solr is no longer running. If there are solr
processes running note there PID
ps aux | grep solr
Manually kill the solr processes by PID. This command is only needed if bundle exec rake sunspot:solr:stop
wasn't successful.
kill -9 PID # (fully turns off solr - double check `ps aux|grep solr`)
Delete your database, double check if you really sure! Then recreate the database and restore the schema from the migration files.
bundle exec rake db:drop
bundle exec rake db:create
bundle exec rake db:migrate
creates a new sunspot configuration config/sunspot.yml
.
rails generate sunspot_rails:install
recreates the solr directory
bundle exec rake sunspot:solr:start
create a new solr index
bundle exec rake sunspot:reindex
Finally refill the empty database with your seed data.
bundle exec rake db:seed
I've got this working by restarting my PC. I guess there was a solr instance incorrectly stopped :-?
This means there is a problem in your config file and solr couldn't start. Check the sunspot logs.