function acquia_search_get_search_host in Acquia Connector 8
Acquia Search helper function. Returns search host.
Parameters
array $subscription: Acquia Subscription.
Return value
string Search server url.
1 call to acquia_search_get_search_host()
- SearchApiSolrAcquiaConnector::defaultConfiguration in acquia_search/
src/ Plugin/ SolrConnector/ SearchApiSolrAcquiaConnector.php
File
- acquia_search/
acquia_search.module, line 80 - Integration between Acquia Drupal and Acquia's hosted solr search service.
Code
function acquia_search_get_search_host(array $subscription = []) {
if (empty($subscription)) {
$subscription = \Drupal::state()
->get('acquia_subscription_data');
}
$search_host = \Drupal::config('acquia_search.settings')
->get('host');
// Adding the subscription specific colony to the heartbeat data.
if (!empty($subscription['heartbeat_data']['search_service_colony'])) {
$search_host = $subscription['heartbeat_data']['search_service_colony'];
}
// Check if we are on Acquia Cloud hosting. @see NN-2503.
if (!empty($_ENV['AH_SITE_ENVIRONMENT']) && !empty($_ENV['AH_CURRENT_REGION'])) {
if ($_ENV['AH_CURRENT_REGION'] == 'us-east-1' && $search_host == 'search.acquia.com') {
$search_host = 'internal-search.acquia.com';
}
elseif (strpos($search_host, 'search-' . $_ENV['AH_CURRENT_REGION']) === 0) {
$search_host = 'internal-' . $search_host;
}
}
return $search_host;
}