Skip to content

Instantly share code, notes, and snippets.

@oniram
Created June 16, 2017 12:59
Show Gist options
  • Save oniram/c20887f57cff023e9058a98a1f2e2722 to your computer and use it in GitHub Desktop.
Save oniram/c20887f57cff023e9058a98a1f2e2722 to your computer and use it in GitHub Desktop.
How configure uuid solr with Dataimporthandler
<!-- solrconfig.xml -->
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
<str name="update.chain">uuid</str> <!-- ADD THIS LINE-->
</lst>
</requestHandler>
<updateRequestProcessorChain name="uuid">
<processor class="solr.UUIDUpdateProcessorFactory">
<str name="fieldName">uuid</str>
</processor>
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>`
<!-- schema.xml -->
<field name="uuid" type="uuid" indexed="true" stored="true" required="true" />
<uniqueKey>uuid</uniqueKey>
<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment