Apache Solr
Drupal, now with a search that doesn't suck!
History lession
- Drupal's core search is database backed.
- Works "good enough" for simple use cases but falls apart for more
complex cases.
- Adds more load to the database layer, which is already taxed by
the CMS.
What is it?
- Search platform built on top of the Apache Lucene project.
- Lucuene provides the "indexing spellchecking, hit highlighting and advanced analysis/tokenization capabilities."
- Solr surfaces this through a web API.
Lucene
"Apache Lucene is a high-performance, full-featured text search engine library written
entirely in Java. It is a technology suitable for nearly any application that requires
full-text search, especially cross-platform."
- Screaming fast seach technology used by some familiar players:
- Apple
- JIRA
- LinkedIn
- Twitter
Solr
- Extends Lucene search engine for features like:
- Data schema with types, dynamic fields, and keys.
- Faceted search and filtering.
- Geospatial search.
- Multiple search indicies.
Hosting Solr
- Run as a standalone process or more reliably run with tomcat.
- (+) More control over configuration.
- (+) Ability to use master/slave or sharded indexes.
- (+) Ability to do server-side document indexing (vs client – Drupal – side).
- (-) Need to support it.
Hosted Solr
- The big Drupal platforms support it out of the box:
- Additional Solr hosts:
Integrating with Drupal
-
Apache Solr Search
- Original solr module.
- Good API hooks and relatively easy to work with.
- Possible to load results with 0 database requests.
- I've committed a bit to it...
Integrating with Drupal
-
Search API +
Search API Solr search
- Extremely flexible search platform with multiple backends.
- Useful for clients that may not initially need or want to
invest in Solr.
- Also has a relatively easy to work with API.
- Relies on entity system to load results.
Faceted Search
- Allow users to narrow searches with suggested keywords.
- Can also show number of results in each facet, leading to more relevant searches.
- Only surfaces categories that will return results.
- Both modules gain facet support with the Facet API module.
Take it further!
- Solr backed views.
-
Location based search.
- Solr as a generic search provider.