Home - pantheon-systems/search_api_pantheon GitHub Wiki
Home | Best Practices | Fun With Indices | Installation | Jargon | Local Development | Processors | Troubleshooting Indices
Search API Pantheon version 8.0 (for solr 8 & Drupal 8 9)
Requirements
This module is for you if you meet the following requirements:
-
Using Drupal 8.8+
-
Hosting the Drupal site on Pantheon's platform
-
Your site uses
composer
to install modules. -
Have Dashboard access to the platform (necessary to deploy code changes)
Intent
This module is meant to simplify the usage of Search API and Search API Solr on Pantheon's Platform.
Search API Solr provides the ability to connect to any Solr server by providing numerous configuration options. This module automatically sets the Solr connection options by extending the plugin from Search API Solr. The module also changes its connection information based on different Pantheon environments and each Pantheon Environment has it's own SOLR CORE. Doing so eliminates the need to do extra work setting up Solr servers for each environment.
What it provides
This module provides Drupal 9 integration with the Apache Solr project. Pantheon's current version as of the update (12/2021) of this document is 8.8.2. From time to time we will update the solr server's software when we're sure we can do it without any service interruption.
Our current solr container has been updated with a patch for the Log4J bug announced in December 2021.
Composer
Composer is the way you should be managing your drupal module requirements. This module will install its dependencies when you use composer to install.
Dependencies (installed by composer):
-
Solarium. Solarium is a Solr client library for PHP and is not Drupal-specific. First, register Drupal.org as a provider of Composer packages. This command should be run locally from the root directory of your Drupal 8 git repository.
-
Search API. Search API is Drupal's module for indexing content entities.
-
Search API Solr. Search API Solr makes search API work with Apache Solr. Composer will manaage which version
-
Guzzle. Guzzle version 6 is standard with Drupal Core
8.x | 9.x
(read 8.x OR 9.x).
Install
To require this module in your composer file:
composer require pantheon-systems/search_api_pantheon ^8 --prefer-dist
Install the module and push an updated composer.lock file to your pantheon environment.
Setup
PLATFORM SUPPORT
See the Drupal.org for complete documentation on Search API. To configure the connection with Pantheon, do the following steps on your Dev environment (or a Multidev):
-
Enable Solr on your Pantheon site
-
Under "Settings" in your Pantheon site dashboard, enable Solr as an add on. This feature is available for sandbox sites as well as paid plans at the Professional level and above.
OR
-
terminus solr:enable {SITE_NAME|SITE_ID}
-
-
Enable Solr 8 in your pantheon.yml file
Add the bolded portion to your pantheon.yml file:
php_version: 7.4 database: version: 10.4 drush_version: 10 search: version: 8
As you promote the code, the Pantheon.yml file will follow the code through environments enabling the solr server, However you will need to create an index for each environment and ensure the content is indexed after creation. Indices are specific to the Solr core with/for which they were created. Indices cannot be exported or moved once created.