Buy Now My Server Login

RESTful API Reference

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.

Responses

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

  • https://www.netaphorsearch.com/search/[yourSearchId]/control/start (Show example)
      <?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>
  • https://www.netaphorsearch.com/search/[yourSearchId]/control/stop (Show example)
      <?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>
  • https://www.netaphorsearch.com/search/[yourSearchId]/control/restart

POST to your server

  • https://www.netaphorsearch.com/search/[yourSearchId]/update/post (Show example)
      <?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

  • https://www.netaphorsearch.com/search/[yourSearchId]/select

Utilities

  • https://www.netaphorsearch.com/search/[yourSearchId]/update/commit (Show example)
      <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>
  • https://www.netaphorsearch.com/search/[yourSearchId]/update/optimize (Show example)
      <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>
  • https://www.netaphorsearch.com/search/[yourSearchId]/update/commitAndOptimize

Server status

  • https://www.netaphorsearch.com/search/[yourSearchId]/status

Errors

A sample XML error response is shown below

  <test>
      <response>
          <messageType>error</messageType>
          <messageBody>Error 400 ERROR:unknown field 'badSolrField'</messageBody>
      </response>
  </test>