oracledrupal

Integrate Drupal with Solr

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

Introduction

NOTE: This guide is only valid for Drupal 7.x

The Bitnami Drupal Stack with Drupal v7 ships a plugin to enable integration between Solr and Drupal. Follow these steps:

  • Ensure that you have a running Drupal instance and a running Solr instance.

  • On the Solr instance, open the Solr port (by default, 8983) so that Drupal can communicate with Solr. Refer to the FAQ for more information on how to open a port.

  • The Bitnami Drupal Stack already has the Apache Solr Search Integration module installed. In case it doesn’t, you can install it from the Drupal administration panel. Then, enable the Solr Search and Access modules.

  • From the Drupal instance, copy the schema.xml and solrconfig.xml files to the Solr instance and place them in the /opt/bitnami/solr/solr/conf directory.

    NOTE: Depending on your installation type, the schema.xml and solrconfig.xml files can be found in the following location:

    • Approach A (Bitnami installations using system packages): /opt/bitnami/drupal/modules/contrib/apachesolr/solr-conf

    • Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/drupal/htdocs/modules/contrib/apachesolr/solr-conf

  • Restart the Solr server:

    $ sudo /opt/bitnami/ctlscript.sh restart solr
    
  • Log in to the Solr administration panel and verify that it now displays drupal-3.0-beta16 or drupal-3.0-0-solr3 or similar in the page heading, as shown below:

    Drupal/Solr integration

  • On the Drupal instance, log in to the Drupal administration panel, navigate to “Modules -> Search toolkit” and enable both the Apache Solr framework and Apache Solr search. Click the “Save configuration” button to save the changes.

    Drupal/Solr integration

  • Click the “Modules -> Solr Search Framework” configuration button and add a new connection using the data below:

    • URL: http://SERVER-IP:8983/solr
    • Name: Remote Solr
  • Test the connection. If the Drupal instance is not able to contact the Solr instance, check that the IP address used in the connection setting above is correct and that the 8983 port is open for connections.

    Drupal/Solr integration

  • Configure the Drupal application to use Solr by default for search, by navigating to the “Configuration -> Search settings” section and enabling Apache Solr search in the default search modules.

  • If the Drupal instance already holds content, re-index the content.

The Drupal instance should now be configured to execute searches using the Solr search engine. Test it by performing a search using the site search block on the Drupal instance and checking the result.

For more information, refer to the documentation for Drupal configuration with Solr.

Last modification July 13, 2020