You are here

public function DrupalApacheSolrService::makeServletRequest in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 Drupal_Apache_Solr_Service.php \DrupalApacheSolrService::makeServletRequest()
  2. 6.3 Drupal_Apache_Solr_Service.php \DrupalApacheSolrService::makeServletRequest()

Make a request to a servlet (a path) that's not a standard path.

@thows Exception

Parameters

string $servlet: A path to be added to the base Solr path. e.g. 'extract/tika'

array $params: Any request parameters when constructing the URL.

array $options: @see drupal_http_request() $options.

Return value

response object

Overrides DrupalApacheSolrServiceInterface::makeServletRequest

File

./Drupal_Apache_Solr_Service.php, line 512

Class

DrupalApacheSolrService
Starting point for the Solr API. Represents a Solr server resource and has methods for pinging, adding, deleting, committing, optimizing and searching.

Code

public function makeServletRequest($servlet, $params = array(), $options = array()) {

  // Add default params.
  $params += array(
    'wt' => 'json',
    'json.nl' => self::NAMED_LIST_FORMAT,
  );
  $url = $this
    ->_constructUrl($servlet, $params);
  $response = $this
    ->_makeHttpRequest($url, $options);
  return $this
    ->checkResponse($response);
}