无法在rails应用程序中使用太阳黑/ solr重新索引 - 错误:在solr配置中出现严重错误

好的,所以我有一个简单的rails应用程序,现在我试图为搜索功能实现太阳黑子。然而,在我用rails g sunspot_rails生成配置文件之后:安装和启动服务器之后,它已经在我的rails app-dir中创建了solr-dir,并且我运行bundle exec rake sunspot:solr:reindex I得到如下跟踪:无法在rails应用程序中使用太阳黑/ solr重新索引 - 错误:在solr配置中出现严重错误

[email protected]:~/railscode/calendar$ bundle exec rake sunspot:solr:reindex --trace 

** Invoke sunspot:solr:reindex (first_time)

** Invoke sunspot:reindex (first_time)

** Invoke environment (first_time)

** Execute environment

** Execute sunspot:reindex

Skipping progress bar: for progress reporting, add gem 'progress_bar' to your Gemfile

rake aborted!

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:

<abortOnConfigurationError>false</abortOnConfigurationError>

in null

-------------------------------------------------------------

Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete><query>type:Event</query></delete>"

Backtrace: /var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:230:in `adapt_response'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:167:in `execute'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:161:in `send_and_receive'

(eval):2:in `post'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:67:in `update'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:131:in `delete_by_query'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/indexer.rb:55:in `remove_all'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `each'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:230:in `adapt_response'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:167:in `execute'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:161:in `send_and_receive'

(eval):2:in `post'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:67:in `update'

/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:131:in `delete_by_query'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/indexer.rb:55:in `remove_all'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `each'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot.rb:464:in `remove_all'

/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/searchable.rb:178:in `solr_remove_all_from_index'

/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/searchable.rb:197:in `solr_reindex'

/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/tasks.rb:54

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/class_set.rb:16:in `each'

/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/class_set.rb:16:in `each'

/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/tasks.rb:53

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'

/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'

/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'

/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'

/var/lib/gems/1.8/gems/rake-0.9.2.2/bin/rake:33

/var/lib/gems/1.8/bin/rake:19:in `load'

/var/lib/gems/1.8/bin/rake:19

Tasks: TOP => sunspot:solr:reindex => sunspot:reindex

我特别好奇这个:

If you want solr to continue after configuration errors, change: 

<abortOnConfigurationError>false</abortOnConfigurationError>

in null

为什么会在空说什么?其他与我具有相同问题的帖子已经指定了solr/conf/solrconfig.xml,并且当我将其更改为false时,没有其他任何事情发生。

如果我从模型中删除搜索块,我没有得到任何错误(但我想这是因为它不尝试做任何事情,然后)

我已经通过运行配置文件XML验证器,并且它表示它的启动标签名称很糟糕,它的错误代码为2 < -1 5 < -2 6 < 90%。 但是,即使我删除了可以给出有效XML的行,重新启动solr,然后尝试重新索引,但我仍然得到相同的错误。

我开始变得绝望在这里,所以任何帮助大大appriciated!

回答:

我有一个非常类似的问题,并通过

  • 停止所有正在运行的Solr的解决了这个问题处理
  • 删除Solr的文件夹
  • 关闭/重新启动计算机
  • 宝石卸载所有相关的宝石
  • 捆绑安装
  • 开始索尔
  • REINDEX Solr的

回答:

它发生在我身上偶尔..在我的情况下,它是Solr的(不是黑子)问题

尝试去

http://localhost:8982/solr/admin 

or http://localhost:8983/solr/admin

or http://[your.domain]:8983/solr/admin

(取决于你使用什么样的环境)

到看看你有什么错误,你有索尔网络服务器

我看到了Java错误消息,并修复它只是删除索引目录,并重新启动索尔

,并开始像预期的那样

希望它帮助

回答:

,或者你可以重新安装宝石。这对我有用。

回答:

更具体地说,我发现我的问题的原因,希望这有助于谁不知道发生了什么事

首先任何的灵魂,我删除的Solr/data文件夹。馊主意。这导致了cakism所描述的错误。

重新启动,删除solr文件夹等将无济于事。只是因为有一个Solr服务器运行的实例,即使使用太阳黑子:solr:stop也不会停止。你必须杀死由实例:

rake sunspot:solr:stop # stop server 

ps -A | grep solr # you'll see the [PID] of the solr server

kill [PID] # replace with the [PID] from above to completely kill the solr instance

在此之后,那么你就可以删除Solr的文件夹,重新启动服务器

回答:

这里是最简单的方式(不需要与宝石或搞乱进行重新启动计算机):

rake sunspot:solr:stop 

如果您已修改了模式的site_root/solr/conf/schema.xml的内容复制到剪贴板

接下来,在site_root/solr

删除整个文件夹的Solr现在运行:

rake sunspot:solr:start 

此命令将创建和重新填充删除Solr的文件夹中。

如果您复制上面的schema.xml,再次打开schema.xml,选择所有内容并复制剪贴板的内容。保存文件。

现在运行:

bundle exec rake sunspot:solr:reindex 

回答:

我面临同样的问题,最后我得到的config/database.yml中有错误的数据库名称和,比我检查sunspot.yml,这个文件也有错误的配置,如IP地址。我修改两个文件,而不是开始工作。

回答:

对我来说,有太多依赖于turn off/restart the computer(这是不可能重新启动),并没有从上面的任何事情(我没有尝试重新启动)。所以,我的工作解决方案是

  1. 转到应用程序根目录。
  2. 使用ps aux | grep solr发现使用kill -9 4313#对我来说4313是Solr的进程ID Solr的process ID
  3. 停止Solr的进程分期rake sunspot:solr:start RAILS_ENV=staging
  4. 重指数的Solr使用rake sunspot:solr:reindex RAILS_ENV=staging

  • 开始的Solr

    就是这样。

    N.B:根据您的需要

  • 以上是 无法在rails应用程序中使用太阳黑/ solr重新索引 - 错误:在solr配置中出现严重错误 的全部内容, 来源链接: utcz.com/qa/266716.html

    回到顶部