The RESTful API is consumed over HTTPS and uses basic or IP authentication. If using basic authentication you will need your serverId, user name and password to connect. IP authentication is permitted for read-only methods only
We have created a search connector in PHP which uses this API and will save you lots of time if you develop using PHP.
All http requests to you search server will result in an XML response with the exception of search (The "select" method). A search request will default to an XML response but you can also specificy an number of other formats, check out the Solr help section.
The XML responses are typically the standard Solr response wrapped in a bit more XML so that it is easier to determine when an error has occured. There is usually <messageType> element which will either report "success" or "error". See below for a sample error response, the URLs below have sample reponses where it is helpful
Server control
<?xml version="1.0" encoding="UTF-8"?>
<response>
<messageType>success</messageType>
<messageBody>
Starting the NetaphorTestSearch service...<br/>
Waiting to start...<br/>
NetaphorTestSearch started.
</messageBody>
</response>
<?xml version="1.0" encoding="UTF-8"?>
<response>
<messageType>success</messageType>
<messageBody>
Stopping the NetaphorTestSearch service...<br/>
Waiting to stop...<br/>
NetaphorTestSearch stopped.
</messageBody>
</response>
POST to your server
<?xml version="1.0" encoding="UTF-8"?>
<response>
<messageType>success</messageType>
<messageBody>
<solr-response>
<request>success</request>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">10035</int>
</lst>
</response>
</solr-response>
</messageBody>
</response>
Search your server
Utilities
<response>
<messageType>success</messageType>
<messageBody>
<solr-response>
<request>success</request>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">10035</int>
</lst>
</response>
</solr-response>
</messageBody>
</response>
<response>
<messageType>success</messageType>
<messageBody>
<solr-response>
<request>Optimize</request>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1638</int>
</lst>
</response>
</solr-response>
</messageBody>
</response>
Server status
A sample XML error response is shown below
<test>
<response>
<messageType>error</messageType>
<messageBody>Error 400 ERROR:unknown field 'badSolrField'</messageBody>
</response>
</test>