(Tutorial) How to set up Apache Solr search for Drupal 6 on a Debian GNU/Linux server

How to set up Apache Solr search for Drupal 6 on a Debian GNU/Linux server


At DrupalCamp Stockholm 2009 Robert Douglass from Acquia talked about Drupal with Apache Solr search. Solr takes searching in Drupal a huge step forward. Speed and faceted search on author/type/term/language/date/CCK fields are the main features. A “Did you mean …” function is there also and it works surprisingly well but seems to only work for English as of now.

There are also some really interesting things coming like multi site searching, dokument searching and searching of external non Drupal sites.

Drupal.org is already using Apache Solr search. Search for Sweden there and I’m the top result! http://drupal.org/search/apachesolr_search/sweden

When you search on Drupal.org or here on xdeb.org check out the blocks on the side on the search result page. They let you sort the result and filter it by author, node type and taxonomy terms. This is faceted search.

For people who don’t want to set up and maintain there own Apache Solr search Acquia has the service Acquia Search with a 30 day trial.

If you still here and want to know how to set up Apache Solr for Drupal 6 on a Debian GNU/Linux server here follows how I did it.

Apache Solr is a Java application and the best way to run it is on a Apache Tomcat server.

We start of by installing the Sun Java Development Kit (JDK) 6 package.
aptitude install sun-java6-jdk

Debian etch (and lenny) only has Tomcat 5.5 as a package and Solr want Tomcat 6 so we need to do a manual install. I decided to put it in /opt but you can use /usr/local also. (If you do remember to change all the “/opt” paths below.)
# wget http://apache.osuosl.org/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz
# tar -xzf apache-tomcat-6.0.18.tar.gz
# mv apache-tomcat-6.0.18 /opt/tomcat6

Now we are ready to install Solr itself. Until Solr 1.4 is released you need to get a nightly build.

| Read more.

Courtesy : Xdeb.org