예제 #1
0
파일: Service.php 프로젝트: bellodox/jsolr
 /**
  * Central method for making a post operation against this Solr Server
  *
  * @param string $url
  * @param string $rawPost
  * @param float $timeout Read timeout in seconds
  * @param string $contentType
  * @return Response
  *
  * @throws \JSolr\Apache\Solr\Http\Transport\Exception If a non 200 response status is returned
  */
 protected function _sendRawPost($url, $rawPost, $timeout = FALSE, $contentType = 'text/xml; charset=UTF-8')
 {
     $httpTransport = $this->getHttpTransport();
     $httpResponse = $httpTransport->performPostRequest($url, $rawPost, $contentType, $timeout);
     $solrResponse = new Response($httpResponse, $this->_createDocuments, $this->_collapseSingleValueArrays);
     if ($solrResponse->getHttpStatus() != 200) {
         throw new \JSolr\Apache\Solr\Exception($solrResponse);
     }
     return $solrResponse;
 }
예제 #2
0
 /**
  * HttpTransportException Constructor
  *
  * @param \JSolr\Apache\Solr\Response $response
  */
 public function __construct(\JSolr\Apache\Solr\Response $response)
 {
     parent::__construct("'{$response->getHttpStatus()}' Status: {$response->getHttpStatusMessage()}", $response->getHttpStatus());
     $this->_response = $response;
 }