SphinxClient::GetLastError PHP Méthode

GetLastError() public méthode

get last error message (string)
public GetLastError ( )
    function GetLastError()
    {
        return $this->_error;
    }

Usage Example

 /**
  * Search in sphinx client
  *
  * @param string $query
  * @param string $index
  * @return SphinxResult|string
  * @throws \Exception
  */
 public function search($query, $index = '*')
 {
     $result = $this->_sphinx_client->Query($query, $index);
     if (!$result) {
         throw new \Exception("Sphinx client error: " . $this->_sphinx_client->GetLastError());
     } else {
         if (!empty($result['warning'])) {
             return $this->_sphinx_client->GetLastWarning();
         }
         return new SphinxResult($result);
     }
 }
All Usage Examples Of SphinxClient::GetLastError