# Using Apache Solr with Drupal

 

 

 

 

### Wayne Eaker, Zengenuity
## Drupal's Core Search Module
## SQL-based searching
## Index table
## Tables Can Get Big

On A2Ethics.org:
200 nodes = 33,456 index table rows

What happens when if you have 200,000 nodes?

MySQL tables with tens of millions of rows will be very difficult to optimize

## Advanced Search
## Search with Views
## Search with Views
## Improving Drupal's Search
  • Handle large numbers of nodes.

  • Provide easier way to find content.

  • More forgiving of typos, alternative spellings.

## What is Apache Solr?
  • Lucene-based search server.

  • Written in Java.

  • High performance.

  • Advanced features.

http://lucene.apache.org/solr/

## Server flow diagram
## Setting up Apache Solr
  • Download Solr 3.x. (1.4.x on D6)

  • Copy configuration files from Drupal module to example/solr/conf.
    schema.xml
    solrconfig.xml
    protwords.txt

  • Start Solr server. (java -jar example/start.jar)

  • Hosted options: Acquia Search, Websolr.com
## Drupal Modules We Need

 

## Connecting Drupal to Apache Solr
## Setting up Facets Note: Only fields which are indexed can be searched or faceted on!
## Importing Nodes into Solr
## Using Solr Search
## Search Pages
## Boosting Fields
## Content Recommendations
## Query suggestions

 

 

Bug in 7.x-1.0-rc4: http://drupal.org/node/1793610

## Searching Withing Attachments

 

Apache Solr Attachments
http://drupal.org/project/apachesolr_attachments

## Multiple Sites in a Single Index

Apache Solr Multisite Search
http://drupal.org/project/apachesolr_multisitesearch

## Multiple Sites on a single server (different indexes)

 

"Multicore" Solr

 

http://www.softwarerockstars.com/article/drupal-apache-solr-search-multi-site-instance-setup

## Solr-related contrib modules
## Wrapup

 

Apache Solr  >  Drupal core search

 

  • High performance with thousands of documents
  • Language stemming
  • Faceted search
  • Multiple custom search pages
  • Content recommendations
  • Query spell-checking and suggestions
  • Search within files
  • Search multiple sites