1
votes

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

enter image description here

After adding id field on schema.xml enter image description here

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><!-- handler to delegate to -->
  <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>
1
Did you reload your core after changing the schema? Also be aware that the schema may have been loaded as a managed schema after being read the first time, and any changes after that will have to be performed through the Schema API. You also add fields in the web interface for the core, if you're using the managed schema (default).MatsLindh
@matslind ye i reloaded. I switched off the managed schema. Thats how i can see my schema change reflecting. Not able to find out the issue.Sthita
@MatsLindh yes you are right it was using managed schema, changed to use my schema after adding <schemaFactory class="ClassicIndexSchemaFactory"/> on my above solrconfig.xml fileSthita

1 Answers

1
votes

After reading solr documentations https://lucene.apache.org/solr/guide/6_6/schema-factory-definition-in-solrconfig.html Added on solrconfig.xml , reloaded and it works thanks

<schemaFactory class="ClassicIndexSchemaFactory"/>