You are here

protected function SolrConnectorPluginBase::connect 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::connect()
  2. 8 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::connect()
  3. 4.x src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::connect()

Prepares the connection to the Solr server.

27 calls to SolrConnectorPluginBase::connect()
SolrConnectorPluginBase::adjustTimeout in src/SolrConnector/SolrConnectorPluginBase.php
Sets a new timeout for queries, but not for indexing or optimization.
SolrConnectorPluginBase::attachServerEndpoint in src/SolrConnector/SolrConnectorPluginBase.php
Attaches an endpoint to the Solr connection to communicate with the server.
SolrConnectorPluginBase::customizeRequest in src/SolrConnector/SolrConnectorPluginBase.php
SolrConnectorPluginBase::doPing in src/SolrConnector/SolrConnectorPluginBase.php
Pings the Solr server to tell whether it can be accessed.
SolrConnectorPluginBase::execute in src/SolrConnector/SolrConnectorPluginBase.php
Executes any query.

... See full list

File

src/SolrConnector/SolrConnectorPluginBase.php, line 299

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

protected function connect() {
  if (!$this->solr) {
    $this->solr = new Client(NULL, $this->eventDispatcher);
    $this->solr
      ->createEndpoint($this->configuration + [
      'key' => 'core',
    ], TRUE);
    $this
      ->attachServerEndpoint();
  }
}