Drupal 7 – Apache Solr and Search API

Yesterday we talked about setting up a Apache Solr for Drupal 7 site search.
Drupal 7 – Setup Apache Solr for site search

If you want to have more control on the search index with flexible search pages. You can consider the Search API and Search API Apache Solr.

1. First of all, we need to start the Solr server just like what we did in Drupal 7 – Setup Apache Solr for site search. But this time we copy the schema.xml and solrconfig.xml from sites/all/modules/search_api_solr to apache-solr-3.4.0/example/solr/conf.

2. Next, we download the SolrPhpClient r60 or r22 to <drupal>/sites/all/libraries. The hierarchy looks like this

  |- SolrPhpClient
     |- Apache/
     |- ChangeLog


3. Go to the apache-solr-3.4.0/example and start the Solr server in background.

  • nohup java -jar start.jar &


4. Enable the Solr search and Search views modules.


5. Go to Configuration » Search and metadata » Search API and click Add server. Make sure you select Solr service for Service class.


6. After the server is created. Click Add index.


7. Select the fields for indexing. Please note that the only the indexed fields can be used in the search view.


8. Configure the Data alterations and Processors

9. Go to the index status tab and click the Index now button.


10. Create a view with Node index.


11. Here is an example.


Done =)



4 thoughts on “Drupal 7 – Apache Solr and Search API”

  1. Hi,
    I am not able to index my content…
    in logs,,error is
    Indexing failed on one of the following entity ids: node/1, node/2
    “400” Status: Bad Request: Bad RequestApache Tomcat/6.0.33 – Error report HTTP Status 400 – ERROR:unknown field ‘site’type Status reportmessage ERROR:unknown field ‘site’description The request sent by the client was syntactically incorrect (ERROR:unknown field ‘site’).Apache Tomcat/6.0.33

    pls help…


  2. When I try to configure Search API, nothing shows up in the Service Class dropdown. Solr is running, and I was able to index…Not sure why Solr Service isn’t showing up in Search API.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.