Customize Solr Config
Steps for how to apply customized Solr configuration on Pantheon.
Before you begin
Ensure you have installed the Search API Pantheon module before proceeding.
Apply Custom Solr Configurations
There are instances where you may want to edit the configuration file like schema.xml or synonyms.txt to customize the search results. The Search API Solr module provides these configuration files via a jump-start config set.
- Copy the
config-setfolder to a new directory inside/code(e.g./code/solr/config).
Relocating these files outside of the web/modules/contrib/search_api_solr path ensures your custom configurations will not be overwritten by future module updates.
- Edit the necessary file (e.g.
synonyms_en.txt) or any configuration files you want to customize.
(Optional) Modify the Solr Schema version name, so there is a differentiator to your custom configuration from the default (e.g., drupal-4.3.5-solr-8.x-1-YOUR-CUSTOM-IDENTIFIER).
-
Commit the changes, it is recommended to test this in a multidev environment.
-
Post the custom schema to the Solr server using the Drush command with the path to your custom config set:
-
Pantheon's platform checks for updated Solr configurations every 5 minutes. Wait 5 minutes to ensure your new custom configuration has been detected and applied by the platform before proceeding to the next step.
-
After making sure the site uses the new Solr configuration, go to
/admin/config/search/search-apiand select your index, then click Rebuild tracking information and then click Index now.
Reloading Solr Core
Reloading Solr Core would be helpful if synonyms or other Solr config that you've recently posted isn't reflecting even after reindexing your site.
Enable the module search_api_solr_admin and then execute the Drush command to reload the Solr server.
Using Drush
Using the Drupal Admin UI
- Go to
/admin/modules - Enable
Search API Solr Admin - Go to
/admin/config/search/search-api - Click the server you want to reload
- You'll be able to see the
Reload Corebutton and you can simply click and confirm to reload - Reindex the site to apply any changes