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/ SolrPhpClient
Install 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.jar
Test 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 Apache Solr search. 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 preference -> Accompte -> Open and add this script to the liste.
gagarine - 02/04/10