This tutorial covers how to configure Solr in Islandora 7.
Configuring Solr out-of-the Box
In order for Solr to work for your collections, you will have to activate the blocks that you want, and configure them to display your desired results. The following instructions will show you how to configure Solr to work with solution packs. Additional information about installing Solr and how Islandora uses Solr is provided in Installing Solr and GSearch. Additional information about customizing Islandora’s Solr Search Module is provided in Chapter 7 - Customizing Islandora.
1. Navigate to the Configuration Panel
Start by going to the ‘Islandora’ page in the admin panel and click on the ‘Solr Client’ link.
2. Verify the Solr URL and Request Handler
The Solr URL should be ip.address.of.site:port/solr. So, for example, if you’re using the Islandora Virtual Machine Image, your Solr URL should be 192.168.56.195:8080/solr, or if using a local installation it should be localhost:8080/solr. If the URL is correct you will see a green check mark.
Make sure the request handler is set to ‘standard’. You can customize the request handler by editing solrconfig.xml to make other request handlers available. This assumes that you are using the default request handler, which will support all the metadata in our solution packs.
3. Set the Default and Secondary Display Profiles
You can modify the way results are displayed by configuring the default display profile. You can choose from List (default), Bookmark, Grid, and Table. Switching back and forth between different display profiles is simple, so feel free to experiment and see which profile best suits your site.
Secondary display profiles provide optional secondary outputs for search results. Out-of-the-box, support for CSV output is provided. Selecting this option will place a CSV button next to your search results.
4. Choose Search Terms in Advanced Search Block
Here you can choose the search terms that will appear in the drop-down menus on the advanced search block. Terms must be entered by their field names (in most cases this will be Dublin Core), though you can optionally specify a more human-readable label with the configure option.To determine the appropriate syntax for your search terms, simply edit the metadata on any object in your repository (for instructions, see How to Edit an Object’s Metadata in Chapter 3. Each field label will display the proper syntax for adding it to your Solr search configuration. A full list of the terms made available by the schema provided in the module package is provided in APPENDIX D - SOLR SCHEMA (SEARCH) Term Reference. Note that you will want to use fields that have been indexed as “text” here.
You also have the option of setting permissions on a per-field basis, allowing only certain subsets of users access to search across different facets. These permissions, and the human-readable label for each Solr field, can be configured by clicking configure to open a new options window:
Solr field permissions are dependent on a role having Drupal permissions to search the Solr index. Roles without this permissions may appear in this list, but they will not be selectable.
5. Choose Facet Fields
Solr uses faceting to filter search results. Here, you can choose which fields you wish to allow faceting on. The format is the same as the search terms described above. You can also use this screen to configure:
- Minimum Limit - The minimum number of search results returned for a particular facet before that facet will be displayed. For instance, if the limit was set to '3' and a search for "fish" returned only two results for 'Bass', 'Bass' would not be included as a facet.
- Soft Limit - The number of facets to show when a search is first returned. This setting will return the most populous facets first, and include a button to expose more available facets.
- Maximum Limit - Similar to a Soft Limit, but without the option to expand to show more terms beyond the limit set here.
Note that you will want to use terms here that have been indexed as “strings” (see Appendix)
6. Choose Sort Fields
Using the same field formatting as Advanced Search and Faceting fields, you can select fields to make available to the user to sort their search results in the Sort block.
The field for a relevance based sort is "score"
7. Set Query Defaults
This section of the configuration panel provides advanced Solr query customization options:
- Limit results to specific namespaces - restrict your search results to a particular namespace. This is useful if there are multiple sites using the same repository and you want to block search results from the other sites. Remember that the namespace is the first half of the PID – everything before the colon.
- Solr Default Query - This option allows you to specify a default query used to browse results when no explicit query has been entered. For example, if a user runs a search and then deletes their search term from the breadcrumbs, this default query will be applied in its place.
- Solr Base Filter - You can use this option as a blanket way to filter all Solr search queries. For example, you can apply date-based or collection-based restrictions. For more information on Solr, see the Solr Reference Guide.
You have successfully configured your Solr client.
For the most current and complete Islandora documentation, please visit our Documentation Wiki