Customize Solr Config
Steps for how to apply customized Solr configuration on Pantheon.
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-set
folder to a new directory inside/code
(e.g./code/solr/config
).cp -r web/modules/contrib/search_api_solr/jump-start/solr8/config-set ./solr/config
Info:NoteRelocating these files outsdie 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.
Login to Drupal Admin and navigate to to
/admin/config/search/search-api
then select your server.Click into the Pantheon Search Admin tab towards the top right of the page, then click the + Post Solr Schema button.
Specify the path of your custom configuration (e.g.,
/code/solr/config
), then click the Post Schema button.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-api
and 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. You can follow this steps on how to enable the Reload Core in your Search API configuration:
- 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 Core
button and you can simply click and confirm to reload - Reindex the site to apply any changes