Skip to content

feat: depend on ddev/ddev-solr, fixes #40 #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@

## What is the difference between this and ddev-solr

Please consider using [ddev/ddev-solr](https://github.com/ddev/ddev-solr), which runs Solr in the modern "Cloud" mode. This offers several advantages. If you are using Drupal, the biggest advantage
is that you can update the Solr Configset from the UI or with a Drush command everytime you update `search_api_solr`.
[ddev/ddev-solr](https://github.com/ddev/ddev-solr) provides the Solr server. This module only adds drupal-specific convenience functions.

The current addon runs in "classic standalone" mode. It is probably simpler at first to setup, but comes with the added maintainance steps for configsets. Most Solr hosting service providers run "Solr Cloud" as a backend.
## Migratiing from 1.x to 2.x

```bash
ddev stop
ddev add-on get ddev/ddev-solr
ddev add-on get ddev/ddev-drupal-solr
ddev restart
```

## Overview

Expand Down
96 changes: 0 additions & 96 deletions docker-compose.solr.yaml

This file was deleted.

36 changes: 28 additions & 8 deletions install.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
name: solr
name: drupal-solr

project_files:
- solr/conf
- solr/docker-entrypoint-initdb.d/solr-configupdate.sh
- docker-compose.solr.yaml
dependencies:
- ddev/ddev-solr

post_install_actions:
# migrate from ddev-drupal-solr 1.x to ddev-solr
pre_install_actions:
- |
#ddev-description:Make sure solr-configupdate.sh is executable
chmod +x solr/docker-entrypoint-initdb.d/solr-configupdate.sh
if [ -d .ddev/solr/conf ]; then
echo "Migrating core 'dev' to ddev-solr ..."
if [ -d .ddev/solr/configsets/dev ]; then
echo "Migration error: .ddev/solr/configsets/dev already exists."
else
echo "Moving ddev/solr/conf to .ddev/solr/configsets/dev/conf ..."
mkdir .ddev/solr/configsets/dev
mv .ddev/solr/conf .ddev/solr/configsets/dev/
echo "Patching .ddev/solr/configsets/dev/conf/solrconfig* ..."
for file in .ddev/solr/configsets/dev/conf/solrconfig*; do
if [ -f "$file" ]; then
cp "$file" "${file}.bak"
sed -i '/<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">/,/<\/queryResponseWriter>/{/<\/queryResponseWriter>/!d;/<\/queryResponseWriter>/d;}' "$file"
sed -i 's/FastLRUCache/CaffeineCache/g; s/LRUCache/CaffeineCache/g; s/LFUCache/CaffeineCache/g; s/FastLRUCache/CaffeineCache/g' "$file"
fi
done
echo "Removing old solr volume ..."
docker volume rm ddev-`ddev status | grep Project: | cut -d ' ' -f 3`_solr
echo "Removing solr/docker-entrypoint-initdb.d ..."
rm -rf solr/docker-entrypoint-initdb.d
echo "... migration finished."
fi
fi

ddev_version_constraint: '>= v1.24.3'
186 changes: 0 additions & 186 deletions solr/conf/accents_en.txt

This file was deleted.

Loading
Loading