0

I am migrating a Solr 4 applcation to Solr 6.2.0. My schema includes the following field:

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

I am using the classic schema. But inspit of this, I keep getting the below exception:

"error-class","org.apache.solr.common.SolrException",
       "root-error-class","org.apache.solr.common.SolrException"],
     "msg":"QueryElevationComponent requires the schema to have a uniqueKeyField.",
     "trace":"org.apache.solr.common.SolrException: QueryElevationComponent requires the schema to have a uniqueKeyField.\n\tat 

What am I missing?

EDIT: Added the field declaration from the schema following question below.

Klaus
  • 2,328
  • 5
  • 41
  • 62
  • Does your schema have an "id" field? Also are you using QueryElevationComponent? if not you can remove references of it from the solrConfig file. – jay Oct 27 '16 at 23:38
  • see https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java#L191 . – marius_neo Oct 27 '16 at 23:41
  • Yes, the schema has an id field. Though I just noticed that it appears after the uniqueKey declaration. Could that be the issue? – Klaus Oct 27 '16 at 23:57
  • comment out elevator search component in solrconfig.xml file and try – Vinod Oct 28 '16 at 07:17

1 Answers1

0

From the documentation: "Note that if you have enabled the QueryElevationComponent in solrconfig.xml it requires the schema to have a uniqueKey of type StrField. It cannot be, for example, an int field."

Also see:

https://wiki.apache.org/solr/SchemaXml#The_Unique_Key_Field https://wiki.apache.org/solr/QueryElevationComponent#elevate.xml

Jim
  • 21
  • 3