Div |
---|
style | float:right |
---|
class | noprint |
---|
|
|
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.
How Islandora uses Solr/Lucene and Gsearch
...
While Solr is not required to run Islandora, it is recommended.
Installing Solr and GSearch
1. Download fedoraGSearch from SourceForge.net and extract the contents of the compressed file. Copy the file fedoragsearch.war to the webapps folder.
Code Block |
---|
cp ~/fedoragsearch.war $FEDORA_HOME/tomcat/webapps/ |
2. Download Solr to your local environment and unpack the downloaded file.
23. Create a directory for Solr. These instructions presume that it will be installed at ~/opt/solr:
Code Block |
---|
mkdir -p /opt/solr |
34. Drag or mv the .war file that is located under the dist directory of your unpacked download to the newly created /opt/solr directory.
4. Create a new file called solr.xml under $CATALINA_HOME/conf/Catalina/localhost and insert the following into the newly created solr.xml file:
...
5. Copy the directory apache-solr-
...
x.
...
5. Navigate to Fedora's home directory and create a gsearch_solr directory:
Code Block |
---|
cd $FEDORA_HOME
mkdir gsearch_solr |
6. Navigate into your newly created gsearch_solr directory:
Code Block |
---|
cd gsearch_solr |
7. Copy the entire contents of the Solr directory (located under /exmple/solr from the unpacked zipped file) to the gsearch_solr directory you just created.x.x/example/solr to $FEDORA_HOME/solr and /exmaple/webapps/solr.war to $FEDORA_HOME/tomcat/webapps
Code Block |
---|
cp -r ~/opt/solr/example/solr $FEDORA_HOME/gsearch_solr |
8. Navigate into the Solr directory and run a print working directory (pwd) command. The system response should yield usr/local/fedora/gsearch_solr/solr
.
Code Block |
---|
cdapache-solr-x.x.x/example/solr $FEDORA_HOME/gsearch_solr
pwd |
9. Restart your web server.
10. Solr should now be up and running. Verify this by going to http://server:8080/solr/admin.
Installing GSearch
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.
Pre-installation software checklist:
It is recommended that Solr be setup, configured and running prior to installing GSearch.
Installation Steps:
1. Download fedoraGSearch from SourceForge.net and extract the contents of the compressed file.
2. Copy the fedoragsearch.war file located in the genericsearch-2.2 directory of the downloaded file to your Fedora webapps directory:
Code Block |
---|
cd genericsearch-2.2
cp fedoragsearch.war $CATALINA_HOME/webapps |
3. Stop and restart your Fedora instance. When you restart, note that a fedoragsearch directory has been created in your Fedora webapps directory.
4. Navigate into the following directory:
Code Block |
---|
cd $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes |
5. Rename the configDemoOnSolr directory config, and navigate to this directory:
Code Block |
---|
mv configDemoOnSolr/ config
cd config |
6. To configure the GSearch service for automatic updating of the Solr index, a few GSearch configuration files must be modified. To do this, make the following edits to the fedoragsearch.properties file:
cp apache-solr-x.x.x/example/webapps/solr.war $FEDORA_HOME/tomcat/webapps/ |
6. Edit the file $FEDORA a. Set the uncommented fedoragsearch.soapBase = http://localhost:8080/fedoragsearch/services
b. Update the fedoragsearch.soapUser = YOURFEDORAUSERNAME
c. Update the fedoragsearch.soapPass = YOURFEDORAPASSWORD
Note: If you have forgotten your Fedora password, it can be found in $FEDORA_HOME/server/config/fedora-users.xml
d. Update fedoragsearch.repositoryNames = gsearch_solr
e. Update fedoragsearch.indexNames = gsearch_solr
Note |
---|
Gsearch properties files are sensitive. A space after the text at the end of a line may cause that entry to fail. |
7. Now we’ll make our GSearch directory by renaming the DemoAtDtu directory using a move command to add an additional user:
Code Block |
---|
cd repository
mv DemoAtDtu gsearch_solr
cd gsearch_solr |
8. The following output details the changes made to the repository.properties file.
Note |
---|
Ensure that the TrustStore path matches the path on your system |
Code Block |
---|
vi repository.properties
\# $Id: repository.properties 5732 2006-11-27 15:26:04Z gertsp $
fgsrepository.repositoryName = gsearch_solr
fgsrepository.fedoraSoap = http://localhost:8080/fedora/services
fgsrepository.fedoraUser = fedoraAdmin
fgsrepository.fedoraPass = fedoraAdmin
fgsrepository.fedoraObjectDir = /usr/local/fedora/data/objectStore
fgsrepository.fedoraVersion = 3.4
fgsrepository.defaultGetRepositoryInfoResultXslt = copyXml
fgsrepository.trustStorePath = TRUSTSTOREPATH/truststore hint: usually /usr/local/fedora/server/truststore
fgsrepository.trustStorePass = TRUSTSTOREPASS hint: usually tomcat |
9. Next, rename the DemoOnSolr directory gsearch_solr:
Code Block |
---|
cd ../..
cd index
mv DemoOnSolr/ gsearch_solr
cd gsearch_solr |
...
<user name="fgsAdmin" password="[password]">
<attribute name="fedoraRole">
<value>administrator</value>
</attribute>
</user> |
7. Edit the file $FEDORA_HOME/tomcat/webapps/fedoragsearch/FgsConfig/fgsconfig-basic.properties
Code Block |
---|
configDisplayName=configProductionOnSolr
gsearchPass= [password]
local.FEDORA_HOME=/usr/local/fedora
namesOfRepositories=FgsRepos
namesOfIndexes=FgsIndex
[keep name in order not to modify GUI for GSearch]
fedoraBase=http://localhost:8080
[to access objects from index in GUI for GSearch]
fedoraPass=[password]
indexEngine=Solr
indexBase=http://localhost:8080/solr |
...
...
${local.FEDORA_HOME}/solr/data/index |
...
indexingDocXslt=foxmlToSolr |
Note |
---|
Gsearch properties files are sensitive. A space after the text at the end of a line may cause that entry to fail. |
8. Navigate to $FEDORA_HOME/tomcat/webapps/fedoragsearch/FgsConfig/and run Apache ant on fgsconfig-basic.xml
Code Block |
---|
cd $FEDORA_HOME/ |
11. Next, make the following changes (During this process you will be putting files that are packaged with the Islandora Solr module to ensure support for Islandora Solution Packs. These are: demoFoxmlToSolr.xslt, schema.xml):
Code Block |
---|
cd /usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/classesFgsConfig/config
mkdir updater
cd updater
cp -R ../../configBasic/updater/* .
cd /usr/local/fedora/gsearch_solr/solr/conf
mv schema.xml schema.xml.bak
mv solrconfig.xml solrconfig.xml.bak
cp ../../../tomcat/webapps/fedoragsearch/WEB-INF/classes/config/index/gsearch_ant -f fgsconfig-basic.xml |
9. Rename the current Solr schema.xml file to schema.bak
Code Block |
---|
mv $FEDORA_HOME/solr/conf/schema.xml .
cp ../../../tomcat/webapps/fedoragsearch/WEB-INF/classes/config/index/gsearch_$FEDORA_HOME/solr/conf/solrconfigschema.xml .bak |
1210. Modify the solrconfig.xml file as follows:
Replace
Code Block |
---|
${solr.data.dir:./solr/data} |
within the <dataDir> tags with
Code Block |
---|
/usr/local/fedora/gsearch_solr/solr/data |
...
Copy the new, ant-generated Solr schema into place as schema.xml
Code Block |
---|
cp $FEDORA_HOME |
...
/tomcat/webapps/fedoragsearch/WEB-INF/classes/ |
...
fgsconfigFinal/index/FgsIndex/conf/schema-x.x.x-for-fgs-x.x.xml $FEDORA_HOME/solr/conf/schema.xml |
11. Restart Fedora.
Code Block |
---|
$FEDORA_HOME/tomcat/bin/shutdown.sh
$FEDORA_HOME/tomcat/bin/startup.sh |
12. Test your installation by going to
14. Once done, copy the lucene jar files from the solr webapp lib directory to the fedoragsearch webapp lib directory using the following commands:
Code Block |
---|
cd $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/lib
cp ../../../solr/WEB-INF/lib/lucene-*.jar . |
15.
Remove the old lucene jar files from the fedoragsearch webapps lib directory. As well, if there are any other duplicates of lucene-* files, remove the older versions:
Code Block |
---|
rm lucene-core-2.4.0.jar |
16. Finally, make the following changes to the demoFoxmlToSolr.xslt:
Code Block |
---|
cd $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/config/index/gsearch_solr/
vi demoFoxmlToSolr.xslt |
Modify the following statement:
Code Block |
---|
<xsl:if test="starts-with($PID,'demo')">
<xsl:apply-templates mode="activeDemoFedoraObject"/>
</xsl:if> |
Remove the 'if' condition, so it looks like this:
Code Block |
---|
<xsl:apply-templates mode="activeDemoFedoraObject"/> |
17. Restart Fedora
18. GSearch and Solr should now be running properly and GSearch should be automatically updating the Solr index. You can see GSearch in action by visiting http://localhost:8080/fedoragsearch/rest
- Login using fgsAdmin
- Click on updateindex
- Click on updateIndex fromFoxmlFiles
Installing & Configuring the Solr Search Module
...