Solr Configuration for Drupal

Submitted by editor on Tue, 12/13/2016 - 10:40
Question

How to setup solr server for Drupal (Drupal 8 and Drupal 7) ?

Step 1. Install Tomcat And Solr Server (atlest 5.4.1)

Step 2. Install Solr Search API On your drupal

#Drush# drush en search_api_solr -y

Step 3. Copy solr core files

You have an example of "Solr configuration" files deleverd with drupal search_api_solr contrib module. onĀ  search_api_solr/solr-conf/5.x. Copy this folder into the solr server core folder (Ex : /opt/solr-5.4.1/server/solr On our example) and rename it (Ex: 5.x -> new_core)

Step 4. Add this core to sorl system.

  • Go to http://127.0.0.1:8983/solr/ (Or your server path)
    • NOTE : If you use Jetty (as the example) server is at port 8983, and Tomcat uses 8080 by default.
  • Click on Core Admin -> Add Core ->Create New Core (Here core name is "new_core")
    • If you have an error like ".../data/elevate.xml not found", copy new_core/elevate.xml file into new_core/data/elevate.xml.

Step 5. Setup Solr on drupal

  • Goto /admin/config/search/search_api -> Add Server
  • Set basic data, (Name = solr_serveur ....)
  • Select Service class = Solr service
  • Configure Solr access
    • Solr path may like /solr or /solr/CORENAME. (Ex: /solr/new_core)
  • Create / Save Server.

Now you can view, edit, configure, index .... your solr from /admin/config/search/search_api/server/SOLR_SERVER_NAME (For the example : /admin/config/search/search_api/server/solr_serveur)

Add new comment