Skip to content

Commit 2082af6

Browse files
authored
build: update to Solr 9 (latest), fixes #69 (#70)
1 parent 506c2ea commit 2082af6

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,33 @@ ddev solr version
195195

196196
Make sure to commit the `.ddev/.env.solr` file to version control.
197197

198+
### Add custom Solr libraries via SOLR_MODULES env variable
199+
200+
Since version 9.8 Solr deprecates lib-directives: https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html#solr-9-8
201+
202+
To enable custom libraries you can use `SOLR_MODULES` environment variable.
203+
204+
By default it is set to `SOLR_MODULES: "extraction,langid,ltr,analysis-extras"` to work with
205+
Drupal Search API Solr default (jump start) config.
206+
207+
You can unset by using:
208+
209+
```
210+
ddev dotenv set .ddev/.env.solr --solr-modules=
211+
```
212+
213+
or set to custom value:
214+
215+
```
216+
ddev dotenv set .ddev/.env.solr --solr-modules=extraction,ltr
217+
```
218+
198219
All customization options (use with caution):
199220

200-
| Variable | Flag | Default |
201-
| -------- | ---- | ------- |
202-
| `SOLR_BASE_IMAGE` | `--solr-base-image` | `solr:9.6` |
221+
| Variable | Flag | Default |
222+
|-------------------|---------------------|-----------|
223+
| `SOLR_BASE_IMAGE` | `--solr-base-image` | `solr:9` |
224+
| `SOLR_MODULES` | `--solr-modules` | `extraction,langid,ltr,analysis-extras` |
203225

204226
### Add third party Solr modules and libraries
205227

@@ -210,6 +232,9 @@ collection's `solrconfig.xml`:
210232
<lib dir="/opt/solr/modules/ddev/lib/" regex=".*\.jar" />
211233
```
212234

235+
Attention: This changed since Solr 9.8, read https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html#solr-9-8
236+
for details.
237+
213238
## Solarium PHP client
214239

215240
[Solarium](https://github.com/solariumphp/solarium) is the leading Solr

docker-compose.solr.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ddev-generated
22
services:
33
solr:
4-
image: ${SOLR_BASE_IMAGE:-solr:9.6}-${DDEV_SITENAME}-built
4+
image: ${SOLR_BASE_IMAGE:-solr:9}-${DDEV_SITENAME}-built
55
build:
66
dockerfile_inline: |
77
ARG SOLR_BASE_IMAGE="scratch"
@@ -15,7 +15,7 @@ services:
1515
RUN sed -i "/\$$rootScope.exceptions = {};/a \$$scope.username = 'solr'; \$$scope.password = 'SolrRocks';" /opt/solr/server/solr-webapp/webapp/js/angular/controllers/login.js
1616
USER solr
1717
args:
18-
SOLR_BASE_IMAGE: ${SOLR_BASE_IMAGE:-solr:9.6}
18+
SOLR_BASE_IMAGE: ${SOLR_BASE_IMAGE:-solr:9}
1919
container_name: ddev-${DDEV_SITENAME}-solr
2020
expose:
2121
- 8983
@@ -30,6 +30,8 @@ services:
3030
#SOLR_HEAP: 1g
3131
SOLR_AUTH_TYPE: basic
3232
SOLR_AUTHENTICATION_OPTS: -Dbasicauth=solr:SolrRocks
33+
# needed for Drupal Search API Solr
34+
SOLR_MODULES: ${SOLR_MODULES-extraction,langid,ltr,analysis-extras}
3335
VIRTUAL_HOST: ${DDEV_HOSTNAME}
3436
HTTP_EXPOSE: 8983:8983
3537
HTTPS_EXPOSE: 8943:8983

0 commit comments

Comments
 (0)