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 details and should be considered a starting point for using 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

Assumptions

Verify

  1. You should be able to view Fedora in a web browser at the following URL: http://localhost:8080/fcrepo/rest

Install, Configure and Start Solr

Download Solr

wget http://archive.apache.org/dist/lucene/solr/4.10.3/solr-4.10.3.tgz
tar -xzvf solr-4.10.3.tgz

The location of your untarred Solr installation will be hereinafter referenced as $SOLR_HOME.

Update Solr schema

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

cd $SOLR_HOME/example
java -jar start.jar

Verify

Install and Start Karaf

Download Karaf

wget http://archive.apache.org/dist/karaf/4.0.5/apache-karaf-4.0.5.tar.gz
tar xvzf apache-karaf-4.0.5.tar.gz

The location of your untarred Karaf installation will be hereinafter referenced as $KARAF_HOME.

Start Karaf

cd $KARAF_HOME
./bin/karaf

Verify

After running the command above

Install, Configure and Start Fedora Camel Toolbox

Install Toolbox

In the Karaf client shell type the following:

feature:repo-add mvn:org.fcrepo.camel/toolbox-features/4.6.2/xml/features
feature:install fcrepo-service-activemq
feature:install fcrepo-indexing-solr

Verify - Toolbox Installation

Still in the Karaf client shell, the following command

feature:list|grep fcrepo

should result in both the fcrepo-camel and fcrepo-indexing-solr features being in the Started state

fcrepo-camel                            | 4.4.3            |          | Started     | fcrepo-camel-4.4.3
fcrepo-indexing-solr                    | 4.6.2            | x        | Started     | toolbox-features-4.6.2
fcrepo-ldpath                           | 4.6.2            |          | Started     | toolbox-features-4.6.2
fcrepo-service-ldcache-file             | 4.6.2            |          | Started     | toolbox-features-4.6.2
fcrepo-marmotta-osgi                    | 4.6.2            |          | Started     | toolbox-features-4.6.2

Verify - LDPath

  1. You should be able to create and navigate to an existing Fedora resource in the web browser, for example http://localhost:8080/fcrepo/rest/collection
  2. Assuming the resource is named "collection", you should be able to verify that the LDPath service is enabled by navigating to the following URL in a web browser: http://localhost:9086/ldpath/collection
    1. You should see a JSON document such as:

      [{"extent":[],"references":[],"prev":[],"altLabel":[],"type":["http://fedora.info/definitions/v4/repository#Container","http://fedora.info/definitions/v4/repository#Resource","http://www.w3.org/ns/ldp#Container","http://www.w3.org/ns/ldp#RDFSource"],"narrowMatch":[],"relation":[],"accrualMethod":[],"notation":[],"id":["http://localhost:8080/fcrepo/rest/collection"],
      ...
      "lastModifiedBy":["bypassAdmin"],"prefLabel":[],"alternative":[],"label":[],"accessTo":[],"createdBy":["bypassAdmin"],"hiddenLabel":[],"comment":[],"accessRights":[],"sameAs":[]
      }]

Configure Toolbox

The main 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:

For configuration details, please refer to the documentation found at the fcrepo-indexing-solr github page. If you updated the $KARAF_HOME/etc/org.fcrepo.camel.indexing.solr.cfg file, it is quite likely that you will also need to update the $KARAF_HOME/etc/org.fcrepo.camel.ldpath.cfg file, particularly the sections related to Fedora location and authorization. Please refer to the fcrepo-ldpath page on github for configuration details.

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: