Skip to content

Instantly share code, notes, and snippets.

@jayakrishnanj
Last active April 4, 2017 15:11
Show Gist options
  • Save jayakrishnanj/efd2093a3f95b83cbc18aa12630102e6 to your computer and use it in GitHub Desktop.
Save jayakrishnanj/efd2093a3f95b83cbc18aa12630102e6 to your computer and use it in GitHub Desktop.
Required to use Multi core search
diff --git a/acquia_search/src/EventSubscriber/SearchSubscriber.php b/acquia_search/src/EventSubscriber/SearchSubscriber.php
index ba98e74..3e885c1 100644
--- a/acquia_search/src/EventSubscriber/SearchSubscriber.php
+++ b/acquia_search/src/EventSubscriber/SearchSubscriber.php
@@ -192,7 +192,10 @@ class SearchSubscriber extends Plugin {
// Use the default.
$identifier = \Drupal::config('acquia_connector.settings')->get('identifier');
$key = \Drupal::config('acquia_connector.settings')->get('key');
-
+ // Hack for multi cores management.
+ if (isset($this->client->getEndpoints()['core']) && !empty($this->client->getEndpoints()['core']->getOptions()['core'])) {
+ $identifier = $this->client->getEndpoints()['core']->getOptions()['core'];
+ }
// See if we need to overwrite these values.
// @todo: Implement the derived key per solr environment storage.
// In any case, this is equal for all subscriptions. Also
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment