Islandora utilizes the Solr open source search platform to enable flexible and configurable indexing and searching. Solr uses the Lucene Java search library at its core for full-text indexing and search and offers hit highlighting, faceted search, dynamic clustering, database integration, and rich document (e.g., Word, PDF) handling as additional features.
The Fedora Generic Search Service, or GSearch, is a search service installed with Fedora that allows for automatic updating of the Lucene/Solr index. GSearch relies on JMS to receive messages that are sent when Fedora objects are ingested, modified or purged. This keeps the Lucene index in sync with the Fedora repository.
Islandora makes it possible to use the power of Solr/Lucene for discovery. Gsearch is used as a method for keeping indexes current. When an item is ingested, the FOXML is transformed by an XSLT file stored in Gsearch into a format that can be read by Solr's schema and returned based on the request handlers in our custom solrconfig.xml.
The Islandora Solr Search module is packaged with files that will support Islandora solution packs, but these can be modified if you are familiar with Solr. Specifically the Solr schema and corresponding Gsearch XSLT are a good starting point even if you do not use the Solr Search module. Additional information about Solr is presented in Chapter 4: Search and Discovery in Islandora (The Solr Module).
While Solr is not required to run Islandora, it is recommended.
1. Download GSearch 2.6, unzip and copy fedoragsearch.war to the Tomcat webapps folder ($CATALINA_HOME/webapps).
$ unzip fedoragsearch-2.6.zip $ cd fedoragsearch-2.6 $ cp -v fedoragsearch.war /usr/local/fedora/tomcat/webapps |
2. Download Solr 4.2.0 and unpack.
$ tar -xzvf solr-4.2.0.tgz |
3. Create a directory for Solr, and copy the contents of solr-4.2.0/example/solr. These instructions presume that it will be installed at /usr/local/fedora/solr:
$ mkdir -p /usr/local/fedora/solr $ cp -Rv solr-4.2.0/example/solr/* /usr/local/fedora/solr |
4. Copy (and rename) solr-4.2.0.war to $CATALINA_HOME/webapps.
$ cp -v solr-4.2.0/dist/solr-4.2.0.war /usr/local/fedora/tomcat/webapps/solr.war |
5. Edit the file $FEDORA_HOME/server/config/fedora-users.xml to add an additional user:
<user name="fgsAdmin" password="[password]"> <attribute name="fedoraRole"> <value>administrator</value> </attribute> </user> |
6. Restart Fedora to deploy GSearch and Solr
$ /usr/local/fedora/tomcat/bin/shutdown.sh $ /usr/local/fedora/tomcat/bin/startup.sh |
7. Edit the file $FEDORA_HOME/tomcat/webapps/fedoragsearch/FgsConfig/fgsconfig-basic-for-islandora.properties. The entries below are of an example setup.
configDisplayName=configProductionSolr gsearchBase=http://localhost:8080 gsearchAppName=fedoragsearch gsearchUser=fgsAdmin gsearchPass=[password] finalConfigPath=/usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/classes logFilePath=/usr/local/fedora/server/logs logLevel=DEBUG namesOfRepositories=FgsRepos namesOfIndexes=FgsIndex fedoraBase=http://localhost:8080 fedoraAppName=fedora fedoraUser=fedoraAdmin fedoraPass=[password] fedoraVersion=3.7.0 objectStoreBase=/usr/local/fedora/data/objectStore indexEngine=Solr indexBase=http://localhost:8080/solr indexDir=/usr/local/fedora/solr/collection1/data/index indexingDocXslt=foxmlToSolr |
Gsearch properties files are sensitive. A space after the text at the end of a line may cause that entry to fail. |
8. Edit $FEDORA_HOME/tomcat/webapps/fedoragsearch/FgsConfig/fgsconfig-basic.xml (replace 'fgsconfig-basic.properties' with 'fgsconfig-basic-for-islandora.properties'):
-- <property file="fgsconfig-basic.properties" /> -- <copy file="fgsconfig-basic.properties" tofile="fgsconfig-basic-${configDisplayName}.properties" preservelastmodified="true" /> -- <copy file="fgsconfig-basic.properties" tofile="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfig-basic-${configDisplayName}.properties" preservelastmodified="true" /> ++ <property file="fgsconfig-basic-for-islandora.properties" /> ++ <copy file="fgsconfig-basic-for-islandora.properties" tofile="fgsconfig-basic-${configDisplayName}.properties" preservelastmodified="true" /> ++ <copy file="fgsconfig-basic-for-islandora.properties" tofile="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfig-basic-${configDisplayName}.properties" preservelastmodified="true" /> |
9. Navigate to $FEDORA_HOME/tomcat/webapps/fedoragsearch/FgsConfig/and run Apache ant on fgsconfig-basic.xml
$ cd /usr/local/fedora/tomcat/webapps/fedoragsearch/FgsConfig/ $ ant -f fgsconfig-basic.xml |
10. Rename the current Solr schema.xml file to schema.bak
$ mv -v /usr/local/fedora/solr/collection1/conf/schema.xml $FEDORA_HOME/solr/collection1/conf/schema.bak |
11. Copy the new, ant-generated Solr schema into place as schema.xml
$ cp -v /usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/conf/schema-4.2.0-for-fgs-2.6.xml $FEDORA_HOME/solr/collection1/conf/schema.xml |
12. Create a context file for Solr at /usr/local/fedora/tomcat/conf/Catalina/localhost/solr.xml
<?xml version="1.0" encoding="UTF-8"?> <Context docBase="/usr/local/fedora/tomcat/webapps/solr.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="/usr/local/fedora/solr" override="true"/> </Context> |
13. Restart Fedora.
$ /usr/local/fedora/tomcat/bin/shutdown.sh $ /usr/local/fedora/tomcat/bin/startup.sh |
14. Test your installation by going to http://localhost:8080/fedoragsearch/rest
15. GSearch and Solr will need to be further configured to index specific datastreams. Sample GSearch and Solr configurations can be found here and here.
The Islandora Solr search module allows you to search the Solr index. The Islandora Solr Sample Configuration module provides default display profiles to the module. The module makes four new blocks available; two for search and two for display. The other block is called the Advanced Search Block and does fielded searches against the Solr index. Both blocks would use whatever request handler is configured in the module settings. For information on how to configure the Solr module, see Chapter 4 - Search and Discovery in Islandora (The Solr Module).
Installation Steps: