Fedora-Solr integration

Camel has a built-in endpoint for Solr, which makes integration really easy. Because the solr-routes are managed in a separate camelContext, they are connected to the fedora-routes over the vm component.

<camelContext id="solr-routes" xmlns="http://camel.apache.org/schema/spring">
  <route id="solr-deletion">
    <description>Solr Deletion</description>
    <from uri="vm:solr.delete"/>
    <setHeader headerName="SolrOperation">
      <constant>DELETE_BY_ID</constant>
    </setHeader>
    <setBody>
      <simple>${header.pid}</simple>
    </setBody>
    <to uri="solr://solr-host:8080/solr"/>
    <log message="removed ${header.pid} from Solr"/>
  </route>
 
  <route id="solr-insertion">
    <description>Solr Insertion</description>
    <from uri="vm:solr.update"/>
    <to uri="xslt:file:///path/to/foxml2solr.xsl"/>
    <setHeader headerName="SolrOperation">
      <constant>INSERT</constant>
    </setHeader>
    <to uri="solr://solr-host:8080/solr"/>
    <log message="Added ${header.pid} to Solr"/>
  </route>
</camelContext>
solr-routes.txt · Last modified: 2013/03/26 12:45 by acoburn@amherst.edu
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International