
Nick SchuchOperations Lead
Maintaining multiple Drupal 7 environments with unique configuration is hard. Maintaining different Solr configuration for these environments is even harder. Enter Search API Solr Overrides; the easier approach.
On the past few projects at PreviousNext we have had a requirement to have a separate Solr configuration for each of our environments. However, we have always found the problem of keeping these separate configurations in the one code base. Some solutions that would solve this problem are:
With the power of settings.php (file not maintained in repository) defined variables and the hook hook_search_api_server_load() provided by search_api we have made a simple contrib module that allows for environment based configuration. Once your site has search_api_solr_overrides installed you can go ahead and update your settings.php using the following example.
$conf['search_api_solr_overrides'] = array( '' => array( 'name' => t('Solr Server (Overridden)'), 'options' => array( 'host' => '', 'port' => '', 'path' => '', ), ), );
Module page - http://drupal.org/project/search_api_solr_overrides