Occasionally, you must override the auto switching behavior in Acquia Search for specific reasons (which can include the following):
Sharing a single Solr index across websites has risks. For more information, see Sharing Solr indexes in read/write mode.
To stop Acquia Search from enabling auto switching, use one of the following methods:
Acquia Search subscribers can choose to manually configure the connections in the settings.php file by overriding variables. For non-hosted subscribers, setting these variables is the only available method to use multiple Acquia Search Solr indexes.
Site Factory subscribers must modify the following provided code examples to use $GLOBALS['gardens_site_settings']['env'] instead of $_ENV['AH_SITE_ENVIRONMENT'], as the value of $_ENV['AH_SITE_ENVIRONMENT'] changes during the code deployment process.
Select the code override to use based on your installed Drupal version and the module in use, from the following tabs:
To override the connection for the current Drupal version:
settings.php file after the Acquia include statement.// Override the ID of the Acquia Search Solr core to use.
// Replace ABCD-123456.env.mysite with the Solr core ID you wish to connect to
// For acquia_search 3.1.7:
// Acquia recommends that you use this option. If you use this option, the system does not override the Solr core used by the Drupal site as one Drupal site can have multiple Solr cores.
$settings['acquia_search']['server_overrides'][$server_id] = 'ABCD-123456.env.mysite';
// For acquia_search 3.1.7 and later:
// Acquia recommends that you avoid using this option. However, if you use this option, the system overrides the Solr core used by the Drupal site.
$settings['acquia_search']['override_search_core'] = 'ABCD-123456.env.mysite';
The server_id refers to the machine name for the Search API Solr server configuration. You can find the machine name at the end of the Solr server URL. For example, if the URL is siteurl/admin/config/search/search-api/server/acquia_search_server, then the machine name is acquia_search_server.
Site Factory subscribers must modify the following provided code examples to use $GLOBALS['gardens_site_settings']['env'] instead of $_ENV['AH_SITE_ENVIRONMENT'], as the value of $_ENV['AH_SITE_ENVIRONMENT'] changes during the code deployment process.
Setting $settings['acquia_search']['read_only'] to FALSE avoids auto switching, causing the production Solr index to enforce read/write mode as shown in the following code example:
$settings['acquia_search']['read_only'] = FALSE;If this content did not answer your questions, try searching or contacting our support team for further assistance.
Occasionally, you must override the auto switching behavior in Acquia Search for specific reasons (which can include the following):
Sharing a single Solr index across websites has risks. For more information, see Sharing Solr indexes in read/write mode.
To stop Acquia Search from enabling auto switching, use one of the following methods:
Acquia Search subscribers can choose to manually configure the connections in the settings.php file by overriding variables. For non-hosted subscribers, setting these variables is the only available method to use multiple Acquia Search Solr indexes.
Site Factory subscribers must modify the following provided code examples to use $GLOBALS['gardens_site_settings']['env'] instead of $_ENV['AH_SITE_ENVIRONMENT'], as the value of $_ENV['AH_SITE_ENVIRONMENT'] changes during the code deployment process.
Select the code override to use based on your installed Drupal version and the module in use, from the following tabs:
To override the connection for the current Drupal version:
settings.php file after the Acquia include statement.// Override the ID of the Acquia Search Solr core to use.
// Replace ABCD-123456.env.mysite with the Solr core ID you wish to connect to
// For acquia_search 3.1.7:
// Acquia recommends that you use this option. If you use this option, the system does not override the Solr core used by the Drupal site as one Drupal site can have multiple Solr cores.
$settings['acquia_search']['server_overrides'][$server_id] = 'ABCD-123456.env.mysite';
// For acquia_search 3.1.7 and later:
// Acquia recommends that you avoid using this option. However, if you use this option, the system overrides the Solr core used by the Drupal site.
$settings['acquia_search']['override_search_core'] = 'ABCD-123456.env.mysite';
The server_id refers to the machine name for the Search API Solr server configuration. You can find the machine name at the end of the Solr server URL. For example, if the URL is siteurl/admin/config/search/search-api/server/acquia_search_server, then the machine name is acquia_search_server.
Site Factory subscribers must modify the following provided code examples to use $GLOBALS['gardens_site_settings']['env'] instead of $_ENV['AH_SITE_ENVIRONMENT'], as the value of $_ENV['AH_SITE_ENVIRONMENT'] changes during the code deployment process.
Setting $settings['acquia_search']['read_only'] to FALSE avoids auto switching, causing the production Solr index to enforce read/write mode as shown in the following code example:
$settings['acquia_search']['read_only'] = FALSE;If this content did not answer your questions, try searching or contacting our support team for further assistance.