Over a million developers have joined DZone.

How to Install Solr 3 on Drupal 7

· Web Dev Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

If you ran into the same problem installing Apache Solr 3.x on Drupal 7.x as one user on Drupal's forum, you're in luck.  That same user figured it out and posted a comment that is organized here as a tutorial. The instructions are for Unix or Mac OS X users, but if you replace the example folders with the correct Windows or Linux parallels, you should be just fine.  These instructions use the Search API, so that is universally applicable to any OS.
  1. 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

  2. Enable ApacheSolr and ApacheSolr Search modules in admin/build/modules

  3. Download Apache Solr http://apache.megamobile.be//lucene/solr/3.4.0/apache-solr-3.4.0.zip


  5. Unpack it somewhere outside your drupal installation and outside your web root/folder. Suggestion would be ~/Servers/apache-solr-3.4

  6. Go to sites/all/contrib/apachesolr/solr-conf and copy all files to ~/Servers/apache-solr-3.4/example/solr/conf

  7. In ~/Servers/apache-solr-3.4/example/solr/conf you can remove schema.xml and rename schema-solr3x.xml to schema.xml

  8. Open your command prompt and do cd ~/Servers/apache-solr-3.4/example

  9. 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!


  11. Test your solr server admin interface by visiting http://localhost:8983/solr/admin
  12. 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
  13. 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
  14. 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... and put an IP-filter in front of it.

  15. 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: http://drupal.org/node/1332144#comment-5213384

The Web Dev Zone is brought to you by Stormpath—offering a complete, pre-built User Management API for building web and mobile applications, and APIs. Download our new whitepaper: "Build Versus Buy: Customer Identity Management for Web and Mobile Applications".


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}