Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Why Use Apache Solr with Drupal?

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:03
    In this presentation, I'm going to look at
  • 0:06
    why you might want to consider using Apache Solr
  • 0:08
    as the tool for indexing and searching the contents of your site.
  • 0:12
    In our case, this is a bit Drupal-specific,
  • 0:15
    but really Solr is a great tool for building custom search engines
  • 0:19
    for just about any platform.
  • 0:21
    We'll start by looking at the Drupal core Search module
  • 0:24
    and talk about some of its limitations,
  • 0:26
    not too much though because if you're taking the time to learn about Solr,
  • 0:30
    you're probably already feeling the pain

Why Use Apache Solr with Drupal?


Apache Solr is a world class search application built on top of the Lucene indexer. Before we start trying to integrate Solr with Drupal lets talk about what Solr is, and what makes it so good, as well as how Solr differs from the Drupal core database-backed Search module. This tutorial is a short presentation explaining Solr, Lucene, and things to consider when choosing Solr as a search technology.

Lucene is an open-source search indexer written in Java and governed by the Apache foundation. It is the underlying library that handles storing indexed content, and does so in a way that makes it extremely flexible. By treating each record as a document made up of any number of different fields Lucene is capable of storing just about anything you throw at it, as long as the resource can be broken up into fields and the textual data can be extracted from those fields. This makes it a good choice for indexing web based content where you might be dealing with HTML, PDF, XML, Microsoft Word, and all kinds of other document formats.

Solr, is an HTTP API for interacting with the Lucene application that makes it easier to create custom search applications. Like Lucene it is also open source, written in Java, and governed by the Apache foundation. Solr's extensive use of XML configuration files allows you to modify almost everything about how Solr works without having to write any Java. This makes it a great choice for anyone that's familiar with PHP but doesn't have Java experience.

When compared with Drupal core's Search module, or any MySQL full-text search tool, Solr has some distinct advantages. Including:

  • Best-in-class stemming and tokenization
  • Scalability; it's designed to scale both vertically and horizontally as needed
  • Built-in support for facets, geospatial searches, and other advanced query options

In addition to these advantages, using Solr for your search can dramatically improve your Drupal site's performance by eliminating costly full-text queries, which can quickly turn MySQL into a bottleneck for sites with even a modest amount of content.

By the end of this tutorial you should be able to explain the advantages that Solr provides over Drupal core's search module and why it's a good choice for building ultra-fast, and accurate, search applications.

Log in or sign up to download companion files.
Additional resources: