我已经在这个链接上使用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项目)索引Model Activity。重新编制索引时,我收到此错误:
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/
答案 0 :(得分:3)
我现在能够重新索引。 schema.xml缺少这一行:
<field name="type" stored="false" type="string" multiValued="true" indexed="true"/>