Skip to content

Apache Solr Search

Karanjit Singh Gill edited this page Jun 23, 2017 · 1 revision

Apache Solr Search:

Configuration steps:

  1. Install and Enable Apache Solr module in Drupal.
  2. Install Solr and make sure it is running.
  3. Goto Configuration -> Search and Metadata -> Apache Solr search
  4. Click +Add search environment.
  5. Enter solr server URL. For example http://localhost:8983/solr/{core_name}
  6. Add a description for the search environment.
  7. You can choose to make this search environment default if it is not already.
  8. Provide read and write access (Recommended).
  9. Click Test Connection to check if the solr is reachable.
  10. Click on Save.
  11. Switch to Default Index Tab.
  12. Under CONFIGURATION select the content-types to be indexed. For example Article,etc.
  13. Click on Save.
  14. Index Site
    1. Under Actions tap on Queue all content for re-indexing
    2. Then click on Index all queued content.
  15. Happy Searching!

Apache Solr Attachments:

Configuration steps:

  1. Skip to #3 if the File field is already set.
  2. Add a File field.
    1. Goto -> Structure -> Content-type -> {any content that needs an attachment} -> Manage Fields -> Add new field -> {field name} -> Select a field type -> FILE
    2. Open Edit tab for the field created above -> Enable Display Field -> Check the field displayed by default checkbox.
    3. Goto Configuration -> Search and Metadata -> Apache Solr Search -> Default Index -> Configuration -> Check the File checkbox -> Save.
  3. Install Apache Solr Attachments module in Drupal.
  4. For SQL 5.7 a change in schema is required(at the time of writing this manual).
    1. Get the patch file from https://www.drupal.org/node/2803667 or use the one here.
    2. Paste the patch in the sites/all/modules/apachesolr_attachments/
    3. Apply the patch to the apachesolr_attachments.install file with the following command
    4. patch apachesolr_attachments.install -i {pathfile}.patch
  5. Enable Apache Solr Attachments module.
  6. Download Apache Tika App jar from https://tika.apache.org/download.html. Ex. tika-app-1.15.jar
  7. Place jar file in the {drupal_root}/sites/all/libraries/{tika_dir} folder
  8. Goto Configuration -> Search and Metadata -> Apache Solr search -> Attachments
  9. Select Tika under Extract using.
  10. Enter the absolute path to the tika directory created in the step #3.
  11. Enter the name of the jar, Ex. tika-app-1.15.jar.
  12. Click Save.
  13. Under Action click on Test your tika extraction to check if the jar is reachable.
  14. Re-index your site.
  15. Happy Searching!

Clone this wiki locally