Prepping for Apache Solr with Drupal

Apache Solr is an advanced search that is coded in Java. With Solr, users are able to narrow and gain a more direct search experience. Installing and getting Solr to work can be intimidating at first due to the number of ways to set it up, and the unique terminologies it presents. Here is a small procedure to prepare for its integration:

orange county drupal developers

  • Try to identify a host that already contains Solr as some hosts won’t allow you to run it on their servers. Even if the host allows you to run Solr on their servers, it will take a little work and know how to manually install it if the package does not already include the installation.
  • Ensure that the version of Solr that you plan to use works with Drupal.
  • Configure the entity types and bundles you want to be indexed in the settings. It’s important to configure this option properly to keep useless or private information out of the index.
  • Customize the facets of the search to narrow down information that is useful to them such as an age or price range in the search options.

The Facets API is the way to integrate with Solr on Drupal 7. It is able for download.

How to configure Apache Solr with Drupal 7

If you have Drupal 7 configured with Linux, here are 8 steps to get Apache Solr up and running with Java.

  1. Install Java as this is the programming language it is written in.
  2. Download the Apache Solr version that is compatible with your Drupal installation.
  3. Configure the schema definitions and rename them by adding a .bak to them in the conf folder. It is a good idea to set up Solr to run multicore if you have multiple sites operating on a single server. One server will be able to index multiple sites on one server. Just add a core row for every site you need indexed in the code.
  4. Every webpage that you want indexed should have a separate folder.
  5. Now it is time to run tests. Lynx should connect with no problems to http://localhost:8983/solr after it has extracted the jar file when running initially.
  6. Create a run script and configure it so that it can be automatically started in the case that the server restarts.
  7. Use Drush to enable Apache Solr’s Framework, Search and Core Search module.
  8. Go to the configuration settings for Apache Solr on your site and amend the URL

If the configuration was done properly, Drupal will give a green message. A red one means something is wrong.

How to get Apache Solr running with Drupal through Tomcat

Some people prefer to use Tomcat to install Solr. Here are 8 steps to get it running with Tomcat:

  1. Install the Tomcat server and verify that it works.
  2. Download the Apache Solr Search Integration module for Drupal 7
  3. Download ApacheSolr Drupal Module 3.6.1 form the Apache site.
  4. Unzip the tarball file in a safe place.
  5. Make a copy of the sample configuration files that are provided with the Solr application and place them in the Solr examples folder.
  6. Test your Solr server with this URL
  7. Ensure that Drupal can access Solr by using “admin/config/search/apachesolr”
  8. Run Cron with Drush to ensure that Drupal is indexing correctly.

Facet API

Searches can be made even more direct with the Facet API. Facet API can be downloaded and integrated with Solr to provide search parameters. A great example of how Facet API works is on a motor vehicle sales website where the user is only looking for a vehicle within the range of $5,000.00 to $10,000.00 and manufactured within the years 2009 – 2012. Facet API would the parameters for the vehicle age and the price.

Keira Rose is an avid hiker that lives & breathes the outdoor life, capturing with her childhood passion of photography. Following her interest in business, she writes columns for orange county drupal developers. 

Leave a Reply