【发布时间】:2023-03-28 21:04:01
【问题描述】:
我已经在带有 Tomcat 6 的 Ubuntu 服务器上设置了 Solr 4.4,点击此链接 - http://www.arborisoft.com/how-to-install-apache-solr-4-4-on-ubuntu-12-04/。
使用 Solr(Ruby on Rails 项目)对模型活动进行索引。重新索引时,我收到此错误:
RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request
Error: {'responseHeader'=>{'status'=>400,'QTime'=>59},'error'=>{'msg'=>'undefined field type','code'=>400}}
URI: http://localhost:8080/solr/update?wt=ruby
Request Headers: {"Content-Type"=>"text/xml"}
Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete><query>type:Activity</query></delete>"
Backtrace: /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:284:in `adapt_response'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:190:in `execute'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:176:in `send_and_receive'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sunspot_rails-2.2.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sunspot_rails-2.2.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:82:in `update'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:146:in `delete_by_query'(eval):2:in `post'
Tasks: TOP => sunspot:solr:reindex => sunspot:reindex
(See full trace by running task with --trace)
sunspot.yml
staging:
solr:
hostname: localhost
port: 8080
log_level: WARNING
path: /solr/
【问题讨论】:
-
检查conf文件夹下是否有配置文件...schema.xml和solrconfig.xml...svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/solr/…
-
conf 文件位于本教程中提到的 /opt/solr/collection1/conf/ 目录中 - arborisoft.com/how-to-install-apache-solr-4-4-on-ubuntu-12-04
-
你有 sunspot.yml 文件吗?
-
是不是和solr版本有关?它适用于我的本地服务器。我在那里配置了 Solr 4.1。我用 solr 4.4 设置了登台服务器。
-
你没有在 sunspot.yml 的路径中提到集合名称:/solr/collection_name
标签: ruby-on-rails solr sunspot solr4 sunspot-solr