- make solr8 / make solr9 switches local Drupal via untracked settings.solr.php - update_solr_config.sh clears conf/ before unzipping the generated config Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
865 B
Bash
Executable File
21 lines
865 B
Bash
Executable File
#! /bin/bash
|
|
# Bascule le Drupal local entre Solr 8 (branche prod) et Solr 9 (branche stage).
|
|
# bin/solr_switch.sh 8|9
|
|
# Écrit (ou supprime) web/sites/default/settings.solr.php, inclus par settings.php, puis drush cr.
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1
|
|
F=public_html/web/sites/default/settings.solr.php
|
|
case "$1" in
|
|
8) rm -f "$F" ;;
|
|
9) cat > "$F" <<'PHP'
|
|
<?php
|
|
// Généré par bin/solr_switch.sh 9 : Drupal local -> conteneur solr9 (Solr 9)
|
|
foreach (['materio', 'database_search_autocomplete'] as $server) {
|
|
$config["search_api.server.$server"]['backend_config']['connector_config']['host'] = 'solr9';
|
|
$config["search_api.server.$server"]['backend_config']['connector_config']['solr_version'] = '9';
|
|
}
|
|
PHP
|
|
;;
|
|
*) echo "usage: $0 8|9" >&2; exit 1 ;;
|
|
esac
|
|
docker exec materiod8-php-1 drush cr >/dev/null && echo "Drupal local -> Solr $1"
|