Error while indexing .xml files in solr

2019-08-05 05:45发布

问题:

I am trying to index xml files in solr search engine using following command:

java -Durl=http://10.1.11.143:8080/solr/#/ -jar post.jar solr.xml

But I am getting following error:

SimplePostTool version 1.5
Posting files to base url http://10.1.11.143:8080/solr/#/ using content-type application/xml..
POSTing file solr.xml
SimplePostTool: WARNING: Solr returned an error #500 Internal Server Error
SimplePostTool: WARNING: IOException while reading response: java.io.IOException:    Server returned HTTP response code: 500 for URL: http://10.1.11.143:8080/solr/#/
1 files indexed.
COMMITting Solr index changes to http://10.1.11.143:8080/solr/#/..
SimplePostTool: WARNING: Solr returned an error #500 Internal Server Error for url http://10.1.11.143:8080/solr/#/?commit=true
Time spent: 0:00:00.017

Please help me to come out of this error. Content of solr.xml is as shown in the picture:

回答1:

The issue is because of the URL. You didn't mention any requestHandler while updating. Use the following command. It'll work.

java -Durl=http://10.1.11.143:8080/solr/update?commit=true -jar post.jar solr.xml

/update is the requestHandler to index data into Solr.