Sunspot for Solr fails with '400 Bad Request' in 'adapt_response'

Updated . Posted . Visible to the public.

If Sunspot does not work and fails with a backtrace similar to this:

/project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:227:in `adapt_response'
/project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:164:in `execute'
/project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:158:in `send_and_receive'
(eval):2:in `post'

then the schema.xml that is shipped with Sunspot is not loaded into Solr correctly.

Often the latter can be found in /etc/solr/conf/schema.xml. So copy Sunspot's schema.xml there, restart Solr and you should be fine.

Thomas Eisenbarth
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Thomas Eisenbarth to makandra dev (2012-02-01 14:43)