You are here

protected function SearchApiSolrAcquiaMultiSubsBackend::connect in Acquia Search Multiple Indexes 8

Creates a connection to the Solr server as configured in $this->configuration.

We need to override the endpoint to enable environment specific detection.

File

src/Plugin/search_api/backend/SearchApiSolrAcquiaMultiSubsBackend.php, line 127

Class

SearchApiSolrAcquiaMultiSubsBackend
Plugin annotation @SearchApiBackend( id = "search_api_solr_acquia_multi_subs", label = @Translation("Acquia Solr Multi Sub"), description = @Translation("Index items using a specific Acquia Apache Solr search server.") )

Namespace

Drupal\acquia_search_multi_subs\Plugin\search_api\backend

Code

protected function connect() {
  parent::connect();
  if (!$this->eventDispatcher) {
    $this->eventDispatcher = $this->solr
      ->getEventDispatcher();
    $plugin = new SearchSubscriber();
    $this->solr
      ->registerPlugin('acquia_solr_search_subscriber', $plugin, $this->configuration['acquia_override_subscription']);

    // Don't use curl.
    $this->solr
      ->setAdapter('Solarium\\Core\\Client\\Adapter\\Http');
  }
}