If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.
Apache Solr is the blazing-fast, open source, multi-modal search platform built on the full-text, vector, and geospatial search capabilities of Apache Lucene™.
This add-on integrates Solr into your DDEV project and creates Solr cores according to the configuration defined in .ddev/typo3-solr/config.yaml.
This add-on is tailored to work with the TYPO3 extension solr. It now supports both server modes: standalone, solrcloud.
ddev add-on get ddev/ddev-typo3-solr
ddev restart
After installation, make sure to commit the .ddev directory to version control.
| Command | Description |
|---|---|
ddev solrctl --help |
Create and destroy solr cores/collections and configsets |
ddev solr-admin |
Open Solr Admin in your browser |
ddev solr |
Run Solr CLI inside the Solr container |
ddev solr-zk |
Run ZooKeeper CLI commands inside the Solr container (SolrCloud only) |
ddev describe |
View service status and used ports for Solr |
ddev logs -s typo3-solr |
Check Solr logs |
Configuration example for TYPO3 in .ddev/typo3-solr/config.yaml:
config: 'vendor/apache-solr-for-typo3/solr/Resources/Private/Solr/solr.xml'
typo3lib: "vendor/apache-solr-for-typo3/solr/Resources/Private/Solr/typo3lib"
configsets:
- name: "ext_solr_13_1_0"
path: "vendor/apache-solr-for-typo3/solr/Resources/Private/Solr/configsets/ext_solr_13_1_0"
cores:
- name: "core_en"
schema: "english/schema.xml"
- name: "core_de"
schema: "german/schema.xml"
ddev solrctl apply
To ensure the cores are created automatically on boot, add the following hook to your .ddev/config.yaml:
hooks:
post-start:
- exec-host: ddev solrctl apply
To connect to the solr service you have to configure the following lines in your site configuration:
solr_enabled_read: true
solr_host_read: <your-site>.ddev.site
solr_path_read: /
solr_port_read: '8984'
solr_scheme_read: https
ddev solrctl wipe
Note
After running wipe, it may take a few seconds until files are synced which may
cause issues when running apply straight after wipe.
ddev solr
Solr initializes its data directory at first boot in a mode-specific layout. Switching modes on an existing volume will fail — the volume must be removed first.
# Set the desired mode
ddev dotenv set .ddev/.env.typo3-solr --solr-mode="solrcloud"
ddev stop
# Remove the Solr volume (required when switching modes)
docker volume rm ddev-$(ddev status -j | docker run -i --rm ddev/ddev-utilities jq -r '.raw.name')_typo3-solr
ddev restart
ddev solrctl apply
Make sure to commit the .ddev/.env.typo3-solr file to version control.
This addon defaults to installing a preferred version of the docker Solr image, but can be configured to use a different version via environment variable (SOLR_BASE_IMAGE).
# Change image version as appropriate.
ddev dotenv set .ddev/.env.typo3-solr --solr-base-image="solr:9.8"
ddev add-on get ddev/ddev-typo3-solr
# Remove old solr volume (required for downgrades)
ddev stop
docker volume rm ddev-$(ddev status -j | docker run -i --rm ddev/ddev-utilities jq -r '.raw.name')_typo3-solr
# Rebuild solr image (required step)
ddev debug rebuild -s typo3-solr
ddev restart
# Confirm the new Solr version
ddev solr version
Make sure to commit the .ddev/.env.typo3-solr file to version control.
All customization options (use with caution):
| Variable | Flag | Default |
|---|---|---|
SOLR_BASE_IMAGE |
--solr-base-image |
solr:9.10 |
SOLR_MODE |
--solr-mode |
standalone (can be standalone or solrcloud) |
Maintained by @b13
If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.