Info |
---|
This guide is meant to get someone 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 cURL, a text editor, java Java, git Git, and a download of Apache Solr 4.6.0. |
Install and Start Fedora 4
...
Warning |
---|
The fcrepo-message-consumer SolrIndexer implementation does not commit upon updates. In order to see the changes, you must configure Solr to have a commit strategy that is appropriate for your use. Node Resource removal events do trigger a commit. |
...
Code Block | ||
---|---|---|
| ||
git clone git@github.com:fcrepo4/fcrepo-message-consumer.git |
Edit
...
the
...
configuration
...
at
...
fcrepo-message-consumer/fcrepo-message-consumer-webapp/src/main/resources/spring/indexer-core.xml
...
to
...
point
...
to
...
your
...
Solr
...
installation.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<!-- 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"> <constructor-arg name="indexers"> <set> <!-- <ref bean="jcrXmlPersist"/> <ref bean="fileSerializer"/> <ref bean="sparqlUpdate"/> --> <!--To enable solr Indexer, please uncomment line below --> <ref bean="solrIndexer"/> </set> </constructor-arg> <!-- If your Fedora instance requires authentication, enter the credentials here. Leave blank if your repo is open. --> <constructor-arg name="fedoraUsername" value="${fcrepo.username:}" /> <!-- i.e., manager, tomcat, etc. --> <constructor-arg name="fedoraPassword" value="${fcrepo.password:}" /> </bean> |
...
Code Block | ||
---|---|---|
| ||
mvn clean install -DskipTests cd fcrepo-message-consumer-webapp mvn -Djetty.port=9999 jetty:run |
Create an Indexable
...
resource
Code Block | ||
---|---|---|
| ||
curl -v -X PUT -H "Content-Type: text/turtle" --data-binary "@object.rdf" "http://localhost:8080/rest/indexableObject" |
...