You are here

protected function SearchApiSolrAcquiaConnector::setPreferredCore in Acquia Search 3.x

Same name and namespace in other branches
  1. 2.x src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php \Drupal\acquia_search\Plugin\SolrConnector\SearchApiSolrAcquiaConnector::setPreferredCore()

Sets the preferred core in the given Solr config.

Parameters

array $configuration: Solr connection configuration.

\Drupal\acquia_search\PreferredSearchCore $preferred_core_service: Service for determining the preferred search core.

Return value

array Updated Solr connection configuration.

1 call to SearchApiSolrAcquiaConnector::setPreferredCore()
SearchApiSolrAcquiaConnector::defaultConfiguration in src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php
Gets default configuration for this plugin.

File

src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php, line 131

Class

SearchApiSolrAcquiaConnector
Class SearchApiSolrAcquiaConnector.

Namespace

Drupal\acquia_search\Plugin\SolrConnector

Code

protected function setPreferredCore(array $configuration, PreferredSearchCore $preferred_core_service) : array {
  $configuration['path'] = '/solr/' . $preferred_core_service
    ->getPreferredCoreId();
  $configuration['host'] = $preferred_core_service
    ->getPreferredCoreHostname();
  $configuration['core'] = $preferred_core_service
    ->getPreferredCoreId();
  $configuration['key'] = self::ENDPOINT_KEY;
  $configuration['overridden_by_acquia_search'] = SearchApiSolrAcquiaConnector::OVERRIDE_AUTO_SET;
  return $configuration;
}