Configuring Solr to use UUID as a key

后端 未结 2 1983
野的像风
野的像风 2020-12-19 17:18

I am trying to configure Solr 4 to work with UUID and so far I am unsuccessful

From reading the documentation I have seen two different ways to configure schema.xml

相关标签:
2条回答
  • 2020-12-19 17:25

    After some work here is the solution:

    In schema.xml, add (or edit) the field field

    <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />   
    

    In solr config, update the chain and add the chain to the handlers (Example: for /update/extract):

    <updateRequestProcessorChain name="uuid">
      <processor class="solr.UUIDUpdateProcessorFactory">
        <str name="fieldName">id</str>
      </processor>
      <processor class="solr.RunUpdateProcessorFactory" />
    </updateRequestProcessorChain>`         
    
    <requestHandler name="/update/extract" 
                    startup="lazy"
                    class="solr.extraction.ExtractingRequestHandler" >
      <lst name="defaults">
        <str name="lowernames">true</str>
        <str name="uprefix">ignored_</str>
        <str name="captureAttr">true</str>
        <str name="fmap.a">links</str>
        <str name="fmap.div">ignored_</str>
        <str name="update.chain">uuid</str>
      </lst>
    </requestHandler>
    
    0 讨论(0)
  • 2020-12-19 17:38

    You may want to remove the Query Elevation component if not using it.

    QueryElevationComponent requires unique key to be defined and it should be a string unique key with JIRA.

    However, it was fixed with the Solr 4.0 alpha so it would depend what Solr version you are using.

    This limitation is documented in the Solr wiki.

    0 讨论(0)
提交回复
热议问题