Simple guide to install Apache Solr 3.x for Drupal 7
A quick and simple guide to get Drupal 7 and Apache Solr version 3.5 or higher running on your local development machine! For the ones that have been resistant in trying out Apache Solr, this is your chance. If you are running an OSX or Unix machine you could be running Apache Solr in under 5 minutes!
Follow these simple steps and you will become a Solr Master very soon!
This guide has been made for unix and mac users. Windows users can probably use the same guide except for the example folders. If you are using Search API most of these steps are applicable to that project as well.
-
Download the Apache Solr 7.x-1.x-dev module from the Apachesolr module and place it in your drupal folder for contributed modules. Typically this is sites/all/contrib
-
Enable ApacheSolr and ApacheSolr Search modules in admin/build/modules
-
Download Apache Solr from a mirror near you : http://www.apache.org/dyn/closer.cgi/lucene/solr/3.5.0
-
Unpack it somewhere outside your drupal installation and outside your web root/folder. Suggestion would be ~/Servers/apache-solr-3.5
-
Go to sites/all/contrib/apachesolr/solr-conf and copy all files to ~/Servers/apache-solr-3.5/example/solr/conf
-
In ~/Servers/apache-solr-3.5/example/solr/conf you can remove schema.xml and rename schema-solr3x.xml to schema.xml. Do the same for solrconfig.xml
-
Open your command prompt and do
cd ~/Servers/apache-solr-3.5/example -
Type the following command to start the Apache Solr service
java -jar start.jar
If all went well your Solr Server is running now! Congratulations! -
Test your solr server admin interface by visiting http://localhost:8983/solr/admin
-
Go to admin/config/search/apachesolr/settings and click on edit. Verify if the url http://localhost:8983/solr/ is correctly entered and click ok
-
Optional : Facets
If you want Facets you should download Facet API and enable it. When this is done you can go to admin/config/search/apachesolr/facets and enable the facets you'd want
-
Optional : Security
Careful because Solr comes unprotected. If you'd like to run Solr in a more permanent basis I would recommend to run it on Tomcat as described in my other guide http://www.nickveenhof.be/blog/setting-drupal-6-apache-solr-tomcat-6-and-ubuntu-910-karmic-koala and put an IP-filter in front of it.
-
Optional : Multicore
if you want to run multicore you can type
java -Dsolr.solr.home=multicore -jar start.jar
Attention: All your files should be in multicore/core0/conf
Source original pdf : http://drupal.org/node/1332144

Comments
This is succinct and great knowledge. I've +1'd the post and look forward to using this as part of my server deployment process for Drupal installs. Kudos and thanks much!
Which version of tomcat is the most appropriate to run apache solr 3.x ?
Well, I am talking about Jetty here. Tomcat version 6 has proven to be very stable. If you like, try it out with tomcat 7 and report back with information!
I tried just about everything with no success. Your instructions was what finally worked.
I'm using Acquia Dev Desktop with Drupal 7 and Solr 3.5. Thanks.
Thanks Nick! :)
Great blog, Nick! This stuff is very helpful.
I'm just getting started with Lucene/Solr and can't figure out the appropriate syntax to use for executing queries via the Solr "admin" interface. For example, I'd like to be able to limit my search to only certain fields. Can you point me to any resources that explain this? (I've looked at the Solr web site, but couldn't make sense of it. :))
Do you know that http://graco-duoglider-stroller.com is an excellent double stroller for your children. It is perfect for both infants and for pre-schoolers.
Pages
Add new comment