Solr: QueryElevationComponent requires StrField uniqueKeyField error

前端 未结 2 1232
北海茫月
北海茫月 2020-12-11 19:09

I recently installed solr. The example index (found at apache-solr-#.#.#\\example\\solr) seems to work, and, once copied to my solr home directory, I am able to access it th

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

    If you are still looking for an answer,

    In schema.xml , include the following

    <fieldType name="uuid" class="solr.UUIDField" indexed="true" /> 
    <field name="id" type="uuid" indexed="true" stored="true" default="NEW" /> 
    

    In elevate.xml, use this ID to map your search term to the best bet result .

    <elevate>
     <query text="foo bar">
      <doc id="4602376f-9741-407b-896e-645ec3ead457" />
     </query>
    </elevate>
    

    Here, 4602376f-9741-407b-896e-645ec3ead457 is the value in the "id" field of the best bet document. Wish, Solr allows us to specify any primary key field , say employeeid or productid for specifying in the elevate.xml

    0 讨论(0)
  • 2020-12-11 19:29

    Yes, at the moment QueryElevationComponent requires a string unique key. This limitation is documented in the Solr wiki.

    Here's the issue in the project JIRA.

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