search

Crafting an Apache Solr Schema.xml Tom Martin Mon, 12/17/2012 - 18:09

Using Apache Solr with Drupal is fairly simple thanks to the apachesolr module, but recently we were tasked with making Solr a vital component of a custom Django project. The Drupal module comes with a Solr schema.xml that is already set up specifically to play nice with Drupal, but we had to craft our own. Setting up Solr, filling it with data, and getting it back out again is relatively easy. However, much like taking a north-Philly street brawler and turning him into Rocky, it takes a bit of work to do it well.

Date-boosting Solr / Drupal search results

By replacing Drupal's core search with Solr, it's possible to gain very fine control of the results. Not only is Solr very flexble, but the apachesolr module is generous with its hooks. One potential use is boosting the score based on dates, so that recent documents receive a higher relevancy score. We've used this for the L.A. Philharmonic's ticket calendar to help patrons find upcoming events.

Ready for transformation?