Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This guide is meant to get someone up and running with a Fedora 4 instance whose updates are automatically indexed in a Solr repository.  This guide glosses over many of the working details and should just be considered a starting point for testing this feature.  The document assumes a posix operating system with curl, a text editor, java, git, and a download of apache solr 4.6.0.

Install and Start Fedora 4

This guide assumes Fedora 4 is running on port 8080 with a jms port of 61616.

Install, Configure and Start Solr

...

Code Block
languagexml
firstline31
linenumberstrue
  <!-- Solr Indexer START-->
  <bean id="solrIndexer" class="org.fcrepo.indexer.solr.SolrIndexer">
    <constructor-arg ref="solrServer" />
  </bean>
  <!--External Solr Server  -->
  <bean id="solrServer" class="org.apache.solr.client.solrj.impl.HttpSolrServer">
    <constructor-arg index="0" value="http://${fcrepo.host:localhost}:${solrIndexer.port:8983}/solr/" />
  </bean>
  <!-- Solr Indexer END-->

  <!-- Message Driven POJO (MDP) that manages individual indexers -->
  <bean id="indexerGroup" class="org.fcrepo.indexer.IndexerGroup">
    <property name="repositoryURL" value="http://${fcrepo.host:localhost}:${fcrepo.port:8080}/rest" />
    <property name="indexers">
      <set>
          <!--
        <ref bean="fileSerializer"/>
        <ref bean="sparqlUpdate"/>   -->
        <!--To enable solr Indexer, please uncomment line below  -->
         <ref bean="solrIndexer"/>
      </set>
    </property>
  </bean>

 

 

 

Start the application (in this case on port 9999).

Code Block
languagebash
mvn clean install -DskipTests
cd fcrepo-jms-indexer-webapp
mvn -DskipTests -D jetty.port=9999 jetty:run

Create an Indexable object

Code Block
languagebash
curl -X POST -H "Content-Type: application/sparql-update" "http://localhost:8080/rest/indexableObject" -d "@object.rdf"
Code Block
titleobject.rdf
linenumberstrue
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#>

DELETE { }
INSERT { <> indexing:hasIndexingTransformation "default"; rdf:type indexing:indexable; dc:title "This title will show up in the index." }
WHERE { }

Ensure that the records are committed to solr (either through an explicit commit or waiting until the configured commit period is up) and then see that they show up.