Solr

Standard use

We provide you with the default schema files provided by search_api_solr version 8.x-1.2. This works for Solr 5.5 and 6.6

Specify the Solr version you would like to use in your docker-compose.yml file, following our example.

Custom schema

If you use a different version of the search_api_solr module, you may need to add your own custom schema. The module allows you to download an easy config.zip file containing what you need.

Also if for any other reason you would like to implement schema customizations for Solr in your project, look to how Lagoon creates our standard images.

  • In the solr section of your docker-compose file replace image: amazeeio/solr:6.6 with:
  build:
    context: .
    dockerfile: solr.dockerfile
  • Place your schema files in your code repository, we typically like to use .lagoon/solr
  • Create a solr.dockerfile
FROM amazeeio/solr:6.6

COPY .lagoon/solr /solr-conf/conf

RUN precreate-core drupal /solr-conf

CMD ["solr-foreground"]

The goal is to have your solr configuration files exist at /solr-conf/conf in the image you are building.

Multiple cores

To implement multiple cores, you will also need to ship your own solr schema as above, the only change needed is to the CMD of the Dockerfile, repeat the pattern of precreate-core corename /solr-conf/ ; for each core you require.


FROM amazeeio/solr:6.6-drupal

RUN precreate-core drupal-index1 /solr-conf && \
    precreate-core drupal-index2 /solr-conf && \
    precreate-core drupal-index3 /solr-conf

CMD ["solr-foreground"]