You are here

public function SolrConnectorPluginBase::execute in Search API Solr 8.2

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

Executes any query.

Parameters

\Solarium\Core\Query\QueryInterface $query:

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

Return value

\Solarium\Core\Query\Result\ResultInterface

Throws

\Drupal\search_api_solr\SearchApiSolrException

Overrides SolrConnectorInterface::execute

5 calls to SolrConnectorPluginBase::execute()
SolrConnectorPluginBase::extract in src/SolrConnector/SolrConnectorPluginBase.php
Executes an extract query.
SolrConnectorPluginBase::optimize in src/SolrConnector/SolrConnectorPluginBase.php
Optimizes the Solr index.
SolrConnectorPluginBase::update in src/SolrConnector/SolrConnectorPluginBase.php
Executes an update query and applies some tweaks.
StandardSolrCloudConnector::graph in src/Plugin/SolrConnector/StandardSolrCloudConnector.php
Executes a stream query.
StandardSolrCloudConnector::stream in src/Plugin/SolrConnector/StandardSolrCloudConnector.php
Executes a stream query.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 827

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

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