You are here

public function SolrConnectorPluginBase::execute 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::execute()
  2. 8.2 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

4 calls to SolrConnectorPluginBase::execute()
SolrConnectorPluginBase::autocomplete in src/SolrConnector/SolrConnectorPluginBase.php
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.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 835

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);
  }
}