Document how to override via settings.php

Created on 30 January 2025, 3 months ago

Problem/Motivation

Acquia Search makes some changes to the way Search API configurations work, which makes it hard to override them on a per-environment basis, e.g. to force the configuration to use a local Solr server when running the site locally with ddev.

Proposed resolution

Document how to customize the Solr configuration for local use with ddev.

Remaining tasks

Document how to customize the Solr configuration for local use with ddev.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ“Œ Task
Status

Active

Version

3.2

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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

Comments & Activities

  • Issue created by @DamienMcKenna
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    This seems to work for ddev, with a server configuration named "solr":

    // Extra settings when using ddev, kept separate to distinguish between what
    // ddev added automatically.
    if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) {
      // Search API Solr.
      $config['search_api.server.solr']['dependencies']['module'] = ['search_api_solr'];
      $config['search_api.server.solr']['backend'] = 'search_api_solr';
      $config['search_api.server.solr']['backend_config']['connector'] = 'standard';
      $config['search_api.server.solr']['backend_config']['connector_config'] = [
        'scheme' => 'http',
        'host' => 'solr',
        'port' => 8983,
        'path' => '/',
        'core' => 'dev',
        'timeout' => 5,
        'index_timeout' => 5,
        'optimize_timeout' => 10,
        'finalize_timeout' => 30,
        'skip_schema_check' => false,
        'solr_version' => '',
        'http_method' => 'AUTO',
        'commit_within' => '1000',
        'jmx' => false,
        'jts' => false,
        'solr_install_dir' => '',
      ];
    }
    
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Note that it didn't work if I didn't set ['dependencies']['module'] and ['backend'], those had to be changed to stop Acquia Search from overriding the configuration.

Production build 0.71.5 2024