Skip to content

Instantly share code, notes, and snippets.

@colorfield
Last active March 16, 2022 05:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save colorfield/2d74317070da950e09eaac18dae92a31 to your computer and use it in GitHub Desktop.
Save colorfield/2d74317070da950e09eaac18dae92a31 to your computer and use it in GitHub Desktop.
Drupal Lando configuration for Solr 8 and Search API
name: drupal-solr
recipe: drupal8
config:
# PHP 7 is required for Search API Solr > 2.
php: '7.4'
webroot: web
proxy:
search:
- admin.solr.lndo.site:8983
# Documentation
# https://docs.lando.dev/config/solr.html
# https://docs.lando.dev/config/services.html
services:
# Spin up a Solr container called "search".
# Set "search" instead of "localhost"
# on the Drupal search api solr server configuration.
search:
# Use a specific Solr version.
type: solr:8
# Optionally declare the name of the Solr core.
# This setting is only applicable for versions 5.5 and above.
core: drupal8
portforward: true
# This should be the directory containing the schema.xml and solrconfig.xml files.
# Download the config.zip and extract it.
config:
conf: solr/conf
@kamalkech
Copy link

drupal8: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core drupal8: Can't load schema /opt/solr/server/solr/mycores/drupal8/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "collated": Error loading class 'solr.ICUCollationField'

@visabhishek
Copy link

So we need to update the config file to $CORE/conf

  • Download the latest config.zip
  • lando ssh -s search
  • cd /opt/solr/server/solr/mycores/drupal8
  • replace conf with unzip config.zip -d $CORE/conf
  • restart lando

@labboy0276
Copy link

labboy0276 commented Aug 1, 2019

One correction to above, run:
lando ssh -s search -u root

This way you don't run into permission issues

Also you do't really need to copy the config in that way. You can put it as a local folder in your setup say in config/solr, then in your lando.yml just do this:

services:
  search:
    type: solr:6.6
    portforward: true
    core: drupal8
    config:
      dir: config/solr

@kamalkech
Copy link

kamalkech commented Mar 9, 2020

There are same update to do :

1- type: solr:7 instead of type: solr:7.1
2- conf: web/modules/contrib/search_api_solr/solr-conf-templates/7.x instead of 
    conf: web/modules/contrib/search_api_solr/solr-conf/7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment