Skip to main content
Last Reviewed: January 15, 2025

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.

  1. 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:
    Note

    Relocating these files outsdie of the web/modules/contrib/search_api_solr path ensures your custom configurations will not be overwritten by future module updates.

  2. 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).

  3. Commit the changes, it is recommended to test this in a multidev environment.

  4. Login to Drupal Admin and navigate to to /admin/config/search/search-api then select your server.

  5. Click into the Pantheon Search Admin tab towards the top right of the page, then click the + Post Solr Schema button.

  6. Specify the path of your custom configuration (e.g., /code/solr/config), then click the Post Schema button.

    Pantheon admin tab solr drupal posting custom configurations

  7. 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.

  8. 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:

  1. Go to /admin/modules
  2. Enable Search API Solr Admin
  3. Go to /admin/config/search/search-api
  4. Click the server you want to reload
  5. You'll be able to see the Reload Core button and you can simply click and confirm to reload
  6. Reindex the site to apply any changes