You are here

public function SolrConnectorPluginBase::executeRequest in Search API Solr 8

Same name and namespace in other branches
  1. 8.3 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::executeRequest()
  2. 8.2 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::executeRequest()
  3. 4.x src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::executeRequest()

Executes a request and returns the response.

Parameters

\Solarium\Core\Client\Request $request:

\Solarium\Core\Client\Endpoint|null $endpoint:

Return value

\Solarium\Core\Client\Response

Throws

\Drupal\search_api_solr\SearchApiSolrException

Overrides SolrConnectorInterface::executeRequest

2 calls to SolrConnectorPluginBase::executeRequest()
SolrConnectorPluginBase::restRequest in src/SolrConnector/SolrConnectorPluginBase.php
Sends a REST request to the Solr server endpoint and returns the result.
SolrConnectorPluginBase::search in src/SolrConnector/SolrConnectorPluginBase.php
Executes a search query and returns the raw response.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 853

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

public function executeRequest(Request $request, Endpoint $endpoint = NULL) {
  $this
    ->connect();
  if (!$endpoint) {
    $endpoint = $this->solr
      ->getEndpoint('core');
  }
  try {
    return $this->solr
      ->executeRequest($request, $endpoint);
  } catch (HttpException $e) {
    $this
      ->handleHttpException($e, $endpoint);
  }
}