Info |
---|
This guide will help you get up and running with a Fedora 4 instance whose updates are automatically indexed in a Solr repository. This guide glosses over many of the details and should be considered a starting point for testing this feature. The document assumes a POSIX operating system with cURL, a text editor, Java, and a download of Apache Solr 4.10.3. |
Versions
Install and Start Fedora 4
...
The location of your untarred Solr installation will be furthermore be referenced as $SOLR_HOME.
...
Code Block | ||
---|---|---|
| ||
wget https://raw.githubusercontent.com/fcrepo4-exts/fcrepo4-vagrant-base-box/master/config/schema.xml cp schema.xml $SOLR_HOME/example/solr/collection1/conf/ |
Start Solr
Code Block | ||
---|---|---|
| ||
cd $SOLR_HOME/example java -jar start.jar |
...
- Navigating to the following URL in a web browser should show the Solr administrative interface: http://localhost:8983/solr/
Install
...
and Start Karaf
Create an Indexable resource
Download Karaf
Code Block | ||
---|---|---|
| ||
curl -v -X PUT -H "Content-Type: text/turtle" --data-binary "@object.rdf" "http://localhost:8080/rest/indexableObject" |
Code Block | ||||
---|---|---|---|---|
| ||||
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX indexing: <http://fedora.info/definitions/v4/indexing#>
<> indexing:hasIndexingTransformation "default"; rdf:type indexing:Indexable; dc:title "This title will show up in the index."
|
wget http://archive.apache.org/dist/karaf/4.0.2/apache-karaf-4.0.2.tar.gz
tar xvzf apache-karaf-4.0.2.tar.gz |
The location of your untarred Karaf installation will be furthermore referenced as $KARAF_HOME.
Start Karaf
Code Block | ||
---|---|---|
| ||
cd $KARAF_HOME
./bin/karaf |
Verify
After running the command above
- you should be presented with some ASCII in your terminal
you should be put into the Karaf client shell, such as:
No Format karaf@root()>
Note, to exit the Karaf client shell, type: "ctrl d"
Install, Configure and Start Fedora Messaging Application Toolbox
Install Toolbox
In the Karaf client shell type the following:
Code Block | ||
---|---|---|
| ||
feature:repo-add mvn:org.fcrepo.camel/toolbox-features/4.5.1/xml/features
feature:install fcrepo-indexing-solr |
Verify
Still in the Karaf client shell, the following command, should...
Code Block | ||
---|---|---|
| ||
feature:list|grep fcrepo |
...result in both the "fcrepo-camel" and "fcrepo-indexing-solr" features being in the "Started" state
Code Block | ||
---|---|---|
| ||
fcrepo-camel | 4.4.1 | | Started | fcrepo-camel-4.4.1
fcrepo-indexing-solr | 4.5.1 | x | Started | toolbox-features-4.5.1 |
Configure Toolbox
The configuration of the "fcrepo-indexing-solr" feature is found at: $KARAF_HOME/etc/org.fcrepo.camel.indexing.solr.cfg
You will need to make updates to this configuration file if any of the following are true:
- Your Solr is deployed at a URL different than the one detailed earlier in this document
- Your Fedora has Authorization enabled, e.g. WebAC
If either of the above are true, edit the configuration file ($KARAF_HOME/etc/org.fcrepo.camel.indexing.solr.cfg), updating the following elements as necessary:
No Format |
---|
# If the fedora repository requires authentication, the following values can be set:
fcrepo.authUsername=
fcrepo.authPassword=
...
# The baseUrl for the Solr server. If using Solr 4.x or better, the URL should include
# the core name.
solr.baseUrl=localhost:8983/solr/collection1 |
Success
You should now be able to create/update/delete resources in your Fedora repository, and subsequently see them in your Solr index!
Resources
For debugging purposes, you may want to inspect the logs of the various applications:
- Fedora log (unless configured otherwise):
/var/log/tomcat8/catalina.out
- Solr log:
$SOLR_HOME/example/logs/solr.log
- Karaf log:
$KARAF_HOME/data/log/karaf.log
Ensure that the records are committed to Solr (either through an explicit commit or waiting until the configured commit period is up) and then verify that they show up.