Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad Request Error When attempting to add documents to server through Solrj

Tags:

solr

solrj

I'm trying to do a simple SolrDocument submission with Java like the one detailed in the Solrj Wiki. However, the submission always fails and returns this:

org.apache.solr.common.SolrException: Bad Request
Bad Request
request: http://address:port/solr/update?wt=xml&version=2.2

I do not run into any issues when querying the Solr server through Solrj, so I don't think there are any problems with the address or connection.

apologizes if this is too vague, but this is all I have to go on. Thanks.

like image 830
BiCen Avatar asked Nov 28 '10 07:11

BiCen


2 Answers

I run into this issue before, my problem is solr document is not valid with the fields defined in schema.xml. So make the fields and types match, and problem will be fixed.

like image 172
dongpf Avatar answered Nov 11 '22 08:11

dongpf


Some of your fields might be wrong according to your schema.xml. Besides seek if there is more than one schema.xml in the classpath your server might be loading the wrong before the correct one.

like image 37
thiagoh Avatar answered Nov 11 '22 07:11

thiagoh