Solr missing mandatory uniqueKey field: id or Unknown field

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Solr missing mandatory uniqueKey field: id or Unknown field

sthita


I am using solr 8.1.1

Created core/collection. Then after update schema & solrconfig i am getting
these errors.
Before adding id field to schema.xml
<https://lucene.472066.n3.nabble.com/file/t489747/sol1.png>
After adding id field on schema.xml
<https://lucene.472066.n3.nabble.com/file/t489747/sol2.png>

Here are my schema.xml & solrconfig.xml, what is wrong i am doing ?

schema.xml :
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="dict" version="1.6">
<field name="title" type="string" stored="true" indexed="true"
required="true" multiValued="false"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="id" type="string"/>
<copyField source="title" dest="id"  />
<uniqueKey>title</uniqueKey>
<fieldType name="string" class="solr.StrField"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0"
positionIncrementGap="0"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0"
positionIncrementGap="0"/>
</schema>

solrconfig:

<?xml version="1.0" encoding="UTF-8"?>

<config>
 
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>  

  <updateHandler class="solr.DirectUpdateHandler2">

    <updateLog>
          <str name="dir">${solr.ulog.dir:}</str>
              </updateLog>

     <autoCommit>
            <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
                   <openSearcher>false</openSearcher>
                        </autoCommit>

     <autoSoftCommit>
            <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
                 </autoSoftCommit>
                   </updateHandler>

  <requestHandler name="/select"
class="solr.SearchHandler"></requestHandler>

  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">

  <lst name="invariants">
  <str name="qt">/select</str>
  <str name="q">title:*</str>
  </lst>
  <str name="healthcheckFile">server-enabled.txt</str>
  </requestHandler>

  <requestHandler name="/update" class="solr.UpdateRequestHandler" />

  <requestHandler name="/replication" class="solr.ReplicationHandler"
startup="lazy" />

  <requestHandler name="/get" class="solr.RealTimeGetHandler">
        <lst name="defaults">
                <str name="omitHeader">true</str>
                     </lst>
                           </config>



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html