This functionality is now mostly included (sans UI) in the D7 and D8 connector modules (Acquia Connector 8.x-1.9+ and 7.x-3.1+, and Search API Acquia 7.x-2.3+). Please read Acquia Help Center: Introduction of connection auto-switching in Acquia Search modules

The D8 version of this module does not work with Acquia Connector >=8.x-1.6 nor with Search API Solr >=8.x-1.x-beta1 (see issue #2833421)

This module allows you to switch between Acquia Search indexes manually or automatically. It's compatible with Apache Solr Search and Search API Solr

To start, you should ensure your site is already connected to your Acquia subscription, and have either of the above modules enabled and configured.

Then enable this module, and go edit your Solr server connection settings (where this is depends on e above modules you're using). By default the module will auto-detect of your environment and attempt to connect this site to the correct Acquia Search Solr index. (E.g. your dev site will use a dev Solr index, your production site will use the production index, etc.).

To verify if you have multiple indexes available, you can deselect the
"Automatically switch when an Acquia Environment is detected" checkbox and it will show you a list of the search indexes that are available for the subscription that you connected with using the Acquia Connector. If you do not see the separate indexes, please file a ticket with Acquia Support to have the additional indexes provisioned for you.

If you want to test the switching locally, add the following to your settings.php:

$_ENV['AH_SITE_NAME'] = 'subscriptionnamedev';
$_ENV['AH_SITE_ENVIRONMENT'] = 'dev';

You can find this variable when you use your drush aliases to connect to your Acquia Server. For example, for your dev site:

drush @myacquiasite.dev ev 'print $_ENV['AH_SITE_ENVIRONMENT'];'
drush @myacquiasite.dev ev 'print $_ENV['AH_SITE_NAME']);'

Alternatively you could fill in data from another subscription so that it takes over your Acquia Search environment without disturbing the connection to the Acquia Connector / Acquia Insight.

Project Information

Downloads