Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we highly recommend scanning the services documentation to get a good handle on how the magicks work.
services: myservice: type: solr:7 portforward: false core: lando config: dir: SEE BELOW
portforward will allow you to access this service externally by assigning a port directly on your host's
localhost. Note that
portforward can be set to either
true or a specific
port but we highly recommend you set it to
true unless you have pretty good knowledge of how port assignment works or you have a very compelling reason for needing a locked down port.
portforward: true will prevent inevitable port collisions and provide greater reliability and stability across Lando apps. That said, one downside of
portforward: true is that Docker will assign a different port every time you restart your application. You can read more about accessing services externally over here.
services: myservice: type: solr portforward: true
services: myservice: type: solr portforward: 8983
Using a custom core
You can easily set up a different core name with the
core config value.
services: myservice: type: solr core: my-core
Solr 5+ only!
core config value does not work for Solr 3.x or 4.x.
Using custom solr config
You will almost certainly need to utilize your own custom Solr config. You can do that by telling Lando to inject solr config from a directory inside of your application.
Consider a Drupal 8 or 9 application injecting the Solr 7.x config directly from the
search_api_solr module as shown in the example below:
A hypothetical project
Note that if using custom configuration you can put your configuration files anywhere inside your application directory. We use a
config directory but you can call it whatever you want such as
.lando. In this example we're using the "jump-start" configuration from
./ |-- web/modules/contrib/search_api_solr/jump-start/solr7/config-set |-- elevate.xml |-- mapping-ISOLatin1Accent.txt |-- protwords.txt |-- schema_extra_fields.xml |-- schema_extra_types.xml |-- schema.xml |-- solrconfig_extra.xml |-- solrconfig_index.xml |-- solrconfig_spellcheck.xml |-- solrconfig.xml |-- solrcore.properties |-- stopwords.txt |-- synonyms.txt |-- ... (and many more) |-- .lando.yml
Landofile's solr config
services: myservice: type: solr config: dir: web/modules/contrib/search_api_solr/jump-start/solr7/config-set