asuka
asuka

Reputation: 2439

Reload Solr core with curl

I'm trying to reload the Solr core (version 3.6.0) by means of the following sentence:

curl http://localhost:8983/solr/admin/cores?action=RELOAD\&core=mycore

When I execute it, I get the following response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <lst name="responseHeader">
      <int name="status">0</int>
      <int name="QTime">1316</int>
   </lst>
</response>

I get a similar response when I put such URL at my browser (the difference is the value of QTime).

My problem is that, if I call to the URL from the browser I can see at the log information that the reload is executed, but if I call it from the CURL statement, I can't see anything at my log info (that is to say, no reload process has been executed).

Do I have to change some config data? It seems like the call is not arriving to the Solr server...

Upvotes: 17

Views: 18528

Answers (2)

Ma&#39;moon Al-Akash
Ma&#39;moon Al-Akash

Reputation: 5403

Try to enclose the URL in the command with double-quotes as follows:

curl "http://localhost:8983/solr/admin/cores?action=RELOAD&core=mycore"

Hope this helps

Upvotes: 23

Jacob
Jacob

Reputation: 609

1.Try to use -A to specify the User-Agent

curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" http://localhost:8983/solr/admin/cores?action=RELOAD\&core=mycore

2.Curl can't exec js scripts

So make sure it is not because of the js scripts.

You can use Developer Tools of chrome or Firebug+Firefox to check the http communication process.

3.Use wireshark or sth to check whether "the call is arriving to the Solr server" or not.

I hope that helps.

Upvotes: 4

Related Questions