Field Solr - _version_ must exist in the schema and be searchable

I am new to Solr and getting an error setting my first core core. I am trying to add a new kernel under the admin panel, but I am getting an error about the version field.

Is there any workaround for this?

Background:

  • OS : Windows
  • Folder Solr : C: \ solr-6.0.0
  • Primary Admin URL : http: // localhost: 8984 / solr / # / ~ cores
  • Created folder for new_core : C: \ solr-6.0.0 \ server \ solr \ new_core
  • Error : error CREATEing SolrCore 'new_core': cannot create kernel [new_core]. Reason: _version_ field must exist in the schema and be searchable (indexed or docValues) and retrievable (stored or docValues) and not multiValued (_version_ does not exist)

Xml Schema:

<?xml version="1.0" encoding="UTF-8" ?> <!-- For fts-solr: This is the Solr schema file, place it into solr/conf/schema.xml. You may want to modify the tokenizers and filters. --> <schema name="dovecot" version="1.1"> <types> <!-- IMAP has 32bit unsigned ints but java ints are signed, so use longs --> <fieldType name="string" class="solr.StrField" omitNorms="true"/> <fieldType name="boolean" class="solr.BoolField" omitNorms="true"/> <fieldType name="long" class="solr.LongField" omitNorms="true"/> <fieldType name="text" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> </fieldType> </types> <fields> <field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/> <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="box" type="string" indexed="true" stored="true" required="true" /> <field name="user" type="string" indexed="true" stored="true" required="true" /> <field name="ns" type="string" indexed="true" stored="true" required="false" /> <field name="last_uid" type="boolean" indexed="true" stored="false" /> <field name="hdr" type="text" indexed="true" stored="false" /> <field name="body" type="text" indexed="true" stored="false" /> </fields> <uniqueKey>id</uniqueKey> <defaultSearchField>body</defaultSearchField> <solrQueryParser defaultOperator="AND" /> </schema> 

Screen shot:

enter image description here

+5
source share
2 answers

Your circuit is based on the example of the old version of Solr very much . You need to either use the version of Solr that is recommended with this version of Dovecot, or configure it to meet new requirements.

Compare your circuit with the basic example circuit that ships with Solr 6. There are quite a few differences:

  • Now the version of the scheme is up to 1.6 (your - 1.1)
  • types and fields of external tags are no longer needed, and you simply specify the types / fields in any order.
  • defaultSearchField and solrQueryParser are considered no longer recommended and should be transferred to the query handler configuration in the solrconfig.xml file

Your field name should also be _version_ (with an underscore). Recommendations for their removal are related to StackOverflow formatting (converting underscore to italics) ...

Do you get an error message after a restart? Or nothing at all. With the new Solr, the kernels should be under the solr house (it seems, it seems) and should contain the core.properties file. If you encounter an error during creation, this file may not have been created, and restarting the server may not notice the collection / kernel at all. Just make sure you repeat the same steps (e.g. creating / registering the kernel) every time you check your changes.

+2
source

I would like to add a solution that helped me here; Solr creates a copy of your configuration file and places it in the [core name]/conf/ folder named managed-schema . Be sure to delete this file after editing the schema file, otherwise your changes will not be detected, because Solr seems to be using a copy, not the original schema.xml file.

+2
source

All Articles