Can't reindex Sunspot SOLR - Error - RSolr::Error::Http - 500 Internal Server Error

前端 未结 9 956
执念已碎
执念已碎 2020-12-18 22:46

Everytime i try to reindex using...

rake sunspot:solr:reindex

These error messages always show:

Error - R

相关标签:
9条回答
  • 2020-12-18 23:16

    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
    
    0 讨论(0)
  • 2020-12-18 23:24

    I've got this working by restarting my PC. I guess there was a solr instance incorrectly stopped :-?

    0 讨论(0)
  • 2020-12-18 23:25

    This means there is a problem in your config file and solr couldn't start. Check the sunspot logs.

    0 讨论(0)
提交回复
热议问题