简体   繁体   中英

Error while reindexing on Solr - RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request - undefined field type

I have setup Solr 4.4 on Ubuntu server with Tomcat 6 following this link - http://www.arborisoft.com/how-to-install-apache-solr-4-4-on-ubuntu-12-04/ .

Model Activity is indexed using Solr (Ruby on Rails project). While reindexing, I get this error:

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/

I'm able to reindex now. schema.xml had this line missing:

<field name="type" stored="false" type="string" multiValued="true" indexed="true"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM