windowscommand-linesolr

Solr causes problem with and without hashtag in command line parameter


Hello I've some problem using solr.

In command line

solr.cmd post -c my_core my_path

the error is

PostTool: WARNING: Response: <p> Searching for Solr?<br/> You must type the correct path.<br/> Solr will respond. </p>

When using

solr.cmd post -c #/my_core my_path

other error

PostTool: WARNING: IOException while posting data: java.io.IOException: Error writing request body to server PostTool: WARNING: IOException while reading response: java.io.IOException: Incomplete output stream ERROR: Error from server at http://localhost:8983/solr/: Expected mime type in [application/vnd.apache.solr.javabin, application/octet-stream] but got text/html. <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 400 La méthode HTTP POST n&apos;&apos;est pas supportée par cette URL</title> </head> <body><h2>HTTP ERROR 400 La méthode HTTP POST n&apos;&apos;est pas supportée par cette URL</h2> <table> <tr><th>URI:</th><td>/solr/</td></tr> <tr><th>STATUS:</th><td>400</td></tr> <tr><th>MESSAGE:</th><td>La méthode HTTP POST n&apos;&apos;est pas supportée par cette URL</td></tr> <tr><th>SERVLET:</th><td>LoadAdminUI</td></tr> </table> </body> </html>

So, the #/ seems to be needed for some command, but not for other. What is the problem ?

In the browser, hashtag is needed

http://localhost:8983/solr ==> hashtag added at he end automatically http://localhost:8983/solr/#

http://localhost:8983/solr/my_core ==> go to the error

Searching for Solr?
You must type the correct path.
Solr will respond.

http://localhost:8983/solr/#/geci/core-overview ==> OK


Solution

  • Solr's error messages are not really appropriate.

    It could be: indexing of the pdf file impossible because not configured in place of Searching for Solr? You must type the correct path. Solr will respond.

    The error came from a bad configuration for the server\solr\my_core\conf\solrconfig.xml file, which is created with minimal properties when creating a new core.

    I took the sample file \sample_techproducts_configs\conf\solrconfig.xml and this time, the indexing works very well, after removing the QueryElevationComponent section.