Installing Apache Solr on Mac OSX Snow Leopard for Drupal
The apachesolr module for Drupal provides a first class search engine with faceted search and more. This module needs a solr server to work.
This post explains how you can install the module and a solr server on Mac OS 10.6.
Snow Leopard has already Java installed so it's pretty easy to install Apache Solr. You can almost follow the readme coming with the module but this give you a fast way ;).
Install apchesolr module
Download apachesolr module and unpack the archive in your drupal installation but DON'T activate it in the admin.
Get the PHP library from the external project by running this command from the apachesolr module directory:
$ svn checkout -r22 http://solr-php-client.googlecode.com/svn/trunk/ SolrPhpClientInstall Solr server
Download Solr 1.4 and unpack the archive in /Applications/apache-solr-1.4.0
For testing and development we can use the example application coming with Solr. This application is found at /Applications/apache-solr-1.4.0/example.
Move the schema.xml and solrconfig.xml that comes with the apacheSolr Drupal module in the folder* /Applications/apache-solr-1.4.0/example/solr/conf/* (add ".back" to the original file).
Now start the solr application by opening the Terminal and executing the command:
$ cd /Applications/apache-solr-1.4.0/example/
$ java -jar start.jarTest that your solr server is now available by visiting http://localhost:8983/solr/admin/

Enable and configure apchesolr module
You can now enable the module . This module depends of the core module search but you can install core searches module to keep only the framework of the search module.
You can configure and watch the index in admin/settings/apachesolr. Good news the default configuration work juste out-of-the-box.
You need to run cron to index content. By default the solr server has a 2 min delay before new contents are processed. Just be patient before your first search :).
Apache Solr provides some default blocks and you can activate more in admin/settings/apachesolr/enabled-filters.
Read also the handbook.
Start solr automaticly on login
Create a file start-solr.sh with this content:
# /bin/sh java -jar /Applications/apache-solr-1.4.0/example/start.jar Go in System preferences -> Accounts -> Open and add this script to the liste.
Comments
#1 ArtÃculos destacados, Octubre de 2010
[...] Instalación de Solr en Snow Leopard. [...]
#2 arnel
Start solr automaticly on login
Create a file start-solr.sh with this content:
# /bin/sh java -jar /Applications/apache-solr-1.4.0/example/start.jar
Go in System preference -> Accompte -> Open and add this script to the liste.
start-solr.sh -> where will i add this?
#3 Matt
On English-language Macs, the place to add an item to run on login (i.e. start-solr.sh) is:
System Preferences > Accounts > (select your account) > Login Items tab > click + to add a new item.
#4 arnel
got it! thanks
#5 David Hazel
Really appreciate the quickstart. Nothing beats a few highlighted code sections you can just scan and grab.
thanks.
#6 HughP
Are you running your drupal on the built in Apache and MySQL, or are you using something like MAMP or XAMPP? Are the directions the same with MAMP?
#7 MAMP Helps « The Journeyler
[...] http://listentothis.net/drupal/installing-apache-solr-mac-osx-snow-leopa... [Some more from [...]
#8 gagarine
Yes same direction. Solr is independent of Apache.
#9 kutuloncat99
excellence! thank you
Post new comment