Override solr search api connection settings per environment basis

Created on 7 September 2016, over 8 years ago
Updated 5 June 2023, almost 2 years ago

I want to be able to override solr search api settings per environment via settings.php file e.g changing the value of the host or port.
Something like what search_api_solr_overrides for drupal 7 module does.

Is there a cleaner approach provided by the solr search_api module?

💬 Support request
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands bonrita

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark ressa Copenhagen

    #9 from 2017 still works well, thanks @mkalkbrenner.

    Here's a one-liner, if only the host needs to be updated, in this example for local development with DDEV and Solr Cloud. Replace SERVERNAME and PROJECTNAME:

    $config['search_api.server.SERVERNAME']['backend_config']['connector_config']['host'] = 'ddev-PROJECTNAME-solr1';

  • 🇵🇱Poland dawid_nawrot

    2025 and drupal11 and it still works, config structure hasn't changed

Production build 0.71.5 2024