Please consider using 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.
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.
This repository allows you to quickly install Apache Solr for Drupal 9+ into a Ddev project using just ddev get ddev/ddev-drupal9-solr
. It follows the Setting up Solr (single core) - the classic way recipe.
ddev get ddev/ddev-drupal9-solr && ddev restart
You may need to install the relevant Drupal requirements: ddev composer require drush/drush drupal/search_api_solr
Enable the search_api_solr
module either using the web interface or ddev drush en -y search_api_solr
Create a Search API server at admin/config/search/search-api
-> "Add server"
Create a server with the following settings
ddev-solr-server
.Solr
Standard
solr
dev
/opt/solr
.ddev restart
If you get a message about Solr having outdated config files, you need to update the included Solr config files.
.ddev/solr/conf/
ddev restart
See the documentation in the doc
folder
This is the classic Drupal solr:8
image recipe used for a long time by Drupal users and compatible with search_api_solr
.
.ddev/docker-compose.solr.yaml
using the solr:8 docker image..ddev/solr/conf
with just a ddev restart
.http://<projectname>.ddev.site:8983/solr/
For example, if the project is named myproject
the hostname will be: http://myproject.ddev.site:8983/solr/
.http://solr:8983/solr/
http://solr:8983/solr/dev
or from the host at http://<projectname>.ddev.site:8983/solr/#/~cores/dev
. You can obviously create other cores to meet your needs.If you want to use a core name other than the default "dev", add a .ddev/docker-compose.solr-env.yaml
with these contents, using the core name you want to use:
services:
solr:
environment:
- SOLR_CORENAME=somecorename
environment:
section.You can delete the "dev" core from http://<projectname>.ddev.site:8983/solr/#/~cores/dev
by clicking "Unload".
solr:8
, and Acquia's hosting requires Solr 7. You'll want to see the contributed recipes for older versions of Solr.