无法重新索引太阳黑子SOLR – 错误 – RSolr ::错误:: Http – 500内部服务器错误

每次我尝试重新索引使用…

耙太阳黑子:solr:reindex

这些错误消息始终显示:

错误 – RSolr ::错误:: Http – 500内部服务器错误 – 正在重试…错误 – RSolr ::错误:: Http – 500内部服务器错误 – 忽略…错误 – RSolr ::错误:: Http – 500内部服务器错误 – 正在重试…错误 – RSolr ::错误:: Http – 500内部服务器错误 – 忽略…

我试图停止然后开始使用…

rake sunspot:solr:stop rake sunspot:solr:start 

但什么都没发生。

现在每次我尝试在localhost中运行我的应用程序…

这是错误:

 RSolr::Error::Http - 500 Internal Server Error Error: Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change: false in null ------------------------------------------------------------- Request Data: "type:Trip" 

比终端中的错误消息更详细的错误消息。

我尝试了很多来自网络的解决方案,例如将Abort Configuration设置为false,但没有任何反应。

错误仍然存​​在。

任何工作都将受到赞赏。

解决方案:

  1. rake sunspot:solr:stop
  2. rm -rvf solr (删除你的/ solr目录)
  3. rake sunspot:solr:start
  4. rake sunspot:solr:reindex

请享用

基于@professormeowingtons提供的答案,在生产中对我有用的是:

  1. $ rake sunspot:solr:stop RAILS_ENV=production
  2. $ rm -rvf solr # delete your /solr directory
  3. $ sudo reboot # reboot the machine RAILS_ENV=production
  4. $ rake sunspot:solr:start RAILS_ENV=production
  5. $ rake sunspot:solr:reindex RAILS_ENV=production

参考@professormeowingtons,您不必删除整个solr目录,因为您可能不想删除诸如schema.xmlsolrconfig.xml类的solr配置。 您收到错误的原因可能是因为索引已损坏,您可以执行的操作是删除’solr / env’即solr/development或/和solr/data/development并重新启动solr服务器。

  1. rake sunspot:solr:stop 2. rm -rf solr/development (Delete your solr/development directory) 3. rm -rf solr/data/development 4. rake sunspot:solr:start 5. rake sunspot:solr:reindex 

如果问题仍然存在,请回滚最近的更改,因为您可能添加了一些错误的配置。

我通过重新启动电脑来完成这项工作。 我猜有一个solr实例错误地停止了: – ?

这意味着您的配置文件中存在问题,并且solr无法启动。 检查太阳黑子日志。

通过localhost检查您的太阳黑子服务器:8982(depelopment)。 如果你得到像控制台一样的错误。 再次尝试localhost:8983(生产)。 对于我的情况,端口8983工作正常,我在rails / config / sunspot.yml更改sunspot配置到端口:8983。 并解决了。

将Rsolr gem升级到最新版本1.0.10.pre1,这对我有用。

现在我能够重新索引我的模型,一切看起来都很好,在生产中。

对于那些在Heroku生产中使用Websolr并在重建索引时遇到此错误的人:

请记住,在查看索引时,必须在“ 高级配置 ”选项卡下的Websolr管理GUI中手动上载schema.xml。 这是直接链接: https://websolr.com/slices//schemahttps://websolr.com/slices//schema

您可以从运行heroku config获取 ,并从WEBSOLR_URL的最后一部分获取它,如下所示: http://index.websolr.com/solr/http://index.websolr.com/solr/

我遇到了这个错误,因为我错误地认为Websolr只会使用我提交给git的schema.xml并将其与所有其他/solr/conf文件一起推送到heroku。

重要的是重置每个可能出现问题的代码

删除solr目录

删除config / sunspot.yml

bundle exec rm -rvf solr(删除solr目录肯定 – 双重检查)

捆绑执行耙太阳黑子:solr:停止(关闭solr)

ps aux | grep solr( id

kill -9 id (完全关闭solr – 双重检查)

捆绑exec rake db:drop

bundle exec rake db:migrate

rails生成sunspot_rails:install(创建config / sunspot.yml)

bundle exec rake sunspot:solr:start(创建solr目录)

捆绑执行耙太阳黑子:reindex

捆绑exec rake db:seed