Files
docker-materio/bin/solr_switch.sh
T
bachirandClaude Opus 5.5 842765d31a Solr 9 local instance (solr9, :8986, configsets from solr_cores_stage worktree)
- 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>
2026-11-11 20:33:53 +01:00

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"