0
votes

I would like to send json data from my android app to a ruby on rails webApp which uses solr search engine. But every time I send data, I get this error message :

RSolr::Error::Http - 400 Bad Request Error: Apache Tomcat/7.0.68 (Ubuntu) - Rapport d''erreur

Etat HTTP 400 - Missing solr core name in path

type Rapport d''état

message Missing solr core name in path

description La requête envoyée par le client était syntaxiquement incorrecte.

Apache Tomcat/7.0.68 (Ubuntu)

URI: http://localhost:8080/solr/update?wt=ruby Request Headers: {"Content-Type"=>"text/xml"} Request Data: "" Backtrace: /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-1.1.1/lib/rsolr/client.rb:288:in adapt_response' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-1.1.1/lib/rsolr/client.rb:189:inexecute' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-1.1.1/lib/rsolr/client.rb:175:in send_and_receive' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot_rails-2.2.5/lib/sunspot/rails/solr_instrumentation.rb:16:inblock in send_and_receive_with_as_instrumentation' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in block in instrument' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:ininstrument' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in instrument' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot_rails-2.2.5/lib/sunspot/rails/solr_instrumentation.rb:15:insend_and_receive_with_as_instrumentation' (eval):2:in post' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-1.1.1/lib/rsolr/client.rb:84:inupdate' /home/wivi/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-1.1.1/lib/rsolr/client.rb:113:in `commit'

I have tried many things but without success. Is there anybody who has an idea to resolve this problem ? Thanks in advance for your help.

Best regards,

1

1 Answers

0
votes

As the error says - you're missing the core name or collection name from the Solr URL.

The core name / collection name is the part after "solr" in the URL:

http://../solr/collection-name

When setting up your Solr core/collection for indexing into, you probably used a collection or core name. This has to be provided to the ruby module you're using, either through the URL or through a specific setting (depends on the library - most just asks you to include it in the URL).

In very old versions of Solr - which only supported one set of data at a time - the URL didn't need to have a core name or collection name present, which is why you might see the old URL formats still around.