Apache Solr is a system for indexing and searching site content. Pantheon provides Apache Solr as a service that works well for the majority of sites on the platform. No permission or action is required from Pantheon to use Solr.
Currently, the version of Solr on Pantheon is Apache Solr v3.6.
However, If you are looking for additional features for more advanced use cases, you may want to consider an external Solr service.
The Opensolr service offers a number of features including:
This doc covers Opensolr configuration for Drupal sites. For WordPress-Opensolr integration, see Opensolr's WPSolr Integration tutorial.
This doc assumes that you have already enabled:
After you have signed up at Opensolr.com, log in and click My Indexes, then click Add New.
To create your index:
After filling out the appropriate fields, click Add Index to create your index. You will then see a card on your dashboard for your index. Click on the index name to go to the overview page for your index. From this page, copy the following information before moving forward:
If you are using Drupal 8 and the Search API module, you need to setup (or disable) HTTP authentication for your Opensolr servers. The ApacheSolr module for Drupal 7 does not support HTTP auth. To do this:
Click the Security link in the left column of the Opensolr dashboard.
To configure, enter a username and password, then click Save. Write it down, as you will need to enter this username and password on the Drupal Search API Add Server form.
Opensolr will remove any special characters, including dashes (
-) from the username and password.
To remove HTTP Authentication, Click Remove HTTP Auth
To get your index working with a Drupal site, set some configuration options in the ApacheSolr module. You can quickly reach the ApacheSolr settings page by appending the following to your site’s URL:
Provide two items to the ApacheSolr configuration:
When you've finished, click Save.
A schema must be pushed in each environment (Dev/Test/Live).
Now that you created the index and configured the ApacheSolr Drupal module to point to the new index, test the connection and make sure ApacheSolr can communicate with the Opensolr index.
admin/config/search/apachesolr/settings and click on your index.
To test the connection, click Test Connection.
If Drupal returns a success message like “Your site has contacted the Apache Solr server”, you have successfully set up your index. If not, go back and complete the configuration steps above.
To get your index working with a Drupal 8 site, set some configuration options in the Search API module. You can quickly reach the Search API settings page by appending the following to your site’s URL:
Provide these items to the Search API Search configuration:
/solr. Depending on the server provider, this may need to remain blank. See Opensolr's Connection Issues FAQ for more information.
If you chose Basic Auth, you will see a section for HTTP Basic Authentication. Enter the username and password values from your Opensolr Index Security page.
Leave everything else with default values provided and click Save. On the resulting Search API server configuration page, you should see messages indicating the Server and Core connections were successful:
Your Opensolr server now needs the Search API Solr
schema.xml and other configuration files. These are located in your site code under
module/contrib/search_api_solr/solr_conf, in a sub-directory according to the Solr version you are using on Opensolr.
Create a zip archive of the files in your Solr version's directory. To do this from the CLI:
# From the solr version directory zip ~/solrconfig.zip ./*
The resulting zip file will be in your home folder.
Go to the Opensolr instance, and click on the "Configuration" tab.
Upload the zip archive.
Now that you've created the server connection, add an index by visiting
admin/config/search/search-api and clicking on the Add index button. Provide the information about your index:
When you have finished, click Save.
Next, add the fields your index should include for indexing.
If you'd like to create custom configurations or manually edit your index, synonyms list, stopwords, etc., you can do so by clicking on the Configuration icon on your Opensolr Search Index's Tools page, then selecting the configuration file you wish to edit.