Good Drupal Search Without Solr

Lucene_logo_green.pngWhen it comes to good Drupal search the options are limited. There’s Drupal core search which isn’t anywhere near the search experience we’ve come to expect. It’s a search engine written by CMS developers. On the other hand we hear about Solr. To use Solr you either need to pay a company like Acquia to host it or run Solr as a Java program on a web server. While the Solr module provides all you need to get it going, for most of us this simply isn’t an option. For those of us who want more than Drupal core search offers but aren’t ready to jump to Solr there’s an option in the middle. The Lucene API module.

Enter Lucene

If your familiar with Apache Lucene you might be thinking, "but, that's Java". Lucene is a Java search library and is used as the basis for Solr. Its a search engine written by search engine developers. Lucky for us, Lucene has been ported to other programming languages and one of those is PHP.

The Lucene API module plugs the PHP port of Lucene into Drupal search. Along with using Lucene to produce the search results it provides faceted search.

Other Additions

There are a few other useful modules that are good to use along the Lucene API.

First, the Porter-Stemmer module. This was designed to work with core search but works here as well. The Porter-Stemmer module makes words their basic root in the search index. So words like ‘blogs’, ‘blogger’, ‘blogging’, and ‘blog’ are all the same in the index.

Have you ever misspelled a word in a search? I know I have. The Search Lucene Did You Mean module helps with this. It offers up the ‘Did you mean’ functionality like Google and Yahoo do. For example, misspell the word explore and it will suggest the correct spelling.

On many sites where there are blogs or other article like content we want to show related content. With the Search Lucene More Like This module related articles can be displayed in a block.

Try It Out

Want to take the search for a try as a user? It's the search powering this site. Use the search box at the top and you can take Lucene for a spin. See the related posts on the right? Those are generated by Lucene as well.

With Lucene we can have good search without jumping all the way to Solr.