Drupal and Apache Solr search are a potent combination in the move towards "digital experiences" online. It is behind a growing number of customized, personalized enterprise platforms for eCommerce, healthcare, physical retail and more. Drupal powers a growing portion of the web, and has been adopted especially by governments around the world, the music industry, media organizations, and retailers. If you have a new web project or and existing Drupal site, the combination of Drupal and Apache Solr is both powerful and easy to set up. The indexing workflow built into the Drupal integration module provides a broad range of automatic facets based on data fields on the Drupal content defined by site administrators. Drupal facilitates further customizations of the UI, indexing, custom facets, and boosting because of an open architecture that provides multiple opportunities for a minimal amount of custom code to alter the behavior. This session will provide a high-level overview of how the Drupal integration works, a tour of the UI configuration options, a few code snippets, and examples of successful Drupal sites using Apache Solr for search.

Transcript

3.
My Agenda
Expose you to Drupal as a free enterprise CMS / WAF
Describe some of the advantages that come from a large
innovative pool of contributors
Explain how Drupal enables you to immediately use key
Apache Solr features without investing in development
Have you leave here convinced that you should consider
using Drupal with Apache Solr for your next project so that
you can deliver a better and more engaging site faster
3

9.
Apache Solr Integration with Drupal
Five years of
integration
At least 20,000
sites using Solr
Active community
of contributors
9

10.
Solr Integration Challenges Are Already Solved
The most important - content indexing
Facets, sorting, and highlighting
Integrated with More Like This and spell-check
Optionally enable content access permissions by indexing
documents with data and ﬁltering Solr results based on
the current user
Works with Solr 1.4.x, 3.5.x, 3.6.x, 4.x
10

12.
Dynamic Content (Node) Types Enriched with
Dynamic Data Fields
Site builders can deﬁne as many content types as needed
in the UI
Each content type can have many associated data ﬁelds deﬁned in the UI and with conﬁgurable rendering
Data ﬁelds from content can be re-used across the site in listing, cross-referencing, and recombination
12

29.
Fully Built Search Pages and Facets"
The Drupal integration allows you to build search pages
(including custom ﬁltering) and facets with no coding
Tune boosts, change query ﬁelds, and apply other
conﬁguration per “environment” (one or more search
pages reference each environment)
If you need deeper control, you can easily write code to
change the interaction with Solr, or write custom searches
29

32.
Two Hooks For Changing the Query?
HOOK_apachesolr_query_prepare()
‣
‣
Invoked before $query is statically cached.
Add or remove sorting options visible to the user.
HOOK_apachesolr_query_alter()
‣
‣
‣
Invoked after $query is statically cached.
Useful for applying operations the user shouldnʼt have the ability to alter.
For example, node access ﬁlters.
32

33.
Example: Poor Manʼs “Entity” Extraction"
Erik Hatcher recently showed how to extract values in
Solr using keep words and regular expressions (Solr 4.4+)
http://searchhub.org/2013/06/27/poor-mans-entityextraction-with-solr/
By shifting this work to a Drupal module, I can make it
easy to conﬁgure and deploy for an existing site.
module code:
https://drupal.org/sandbox/pwolanin/2129005
33

38.
To Wrap Up
Drupal has extensive Apache Solr integration, and is
highly customizable
The Drupal platform is widely adopted, and the Drupal
community drives rapid innovation
Acquia provides Enterprise Drupal support and a network
of partners
Acquia includes a secure, hosted Solr index with every
support subscription
38