You are here

protected function Drupal_Apache_Solr_Service::_sendRawGet in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 5.2 Drupal_Apache_Solr_Service.php \Drupal_Apache_Solr_Service::_sendRawGet()
  2. 6 Drupal_Apache_Solr_Service.php \Drupal_Apache_Solr_Service::_sendRawGet()

Central method for making a get operation against this Solr Server

See also

Apache_Solr_Service::_sendRawGet()

3 calls to Drupal_Apache_Solr_Service::_sendRawGet()
Drupal_Apache_Solr_Service::search in ./Drupal_Apache_Solr_Service.php
Switch to POST for search if resultant query string is too long.
Drupal_Apache_Solr_Service::setLuke in ./Drupal_Apache_Solr_Service.php
Sets $this->luke with the meta-data about the index from admin/luke.
Drupal_Apache_Solr_Service::setStats in ./Drupal_Apache_Solr_Service.php
Sets $this->stats with the information about the Solr Core form /admin/stats.jsp

File

./Drupal_Apache_Solr_Service.php, line 317

Class

Drupal_Apache_Solr_Service

Code

protected function _sendRawGet($url, $timeout = FALSE) {
  list($data, $headers) = $this
    ->_makeHttpRequest($url, 'GET', array(), '', $timeout);
  $response = new Apache_Solr_Response($data, $headers, $this->_createDocuments, $this->_collapseSingleValueArrays);
  $code = (int) $response
    ->getHttpStatus();
  if ($code != 200) {
    $message = $response
      ->getHttpStatusMessage();
    if ($code >= 400 && $code != 403 && $code != 404) {

      // Add details, like Solr's exception message.
      $message .= $response
        ->getRawResponse();
    }
    throw new Exception('"' . $code . '" Status: ' . $message);
  }
  return $response;
}