Reputation: 807
I've taken over an abandoned project that is supposed to use Solr for searching and indexing, but Solr isn't working properly. There appear to be 3 cores, none of which had a conf
directory or schema.xml
files, so I wrote the schema below and pasted it onto the 3 cores' conf
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="mwplus_schema" version="1.6">
<field name="_version_" type="long" indexed="true" stored="false" />
<field name="pid" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
<field name="text" type="text" indexed="true" stored="true" multiValued="true"/>
<uniqueKey>pid</uniqueKey>
<defaultSearchField>text</defaultSearchField>
<solrQueryParser defaultOperator="OR"/>
</schema>
As you can see, the _version_
field exists, however when I do bin/solr start -f -p <port>
, none of the 3 cores that are using this schema are able to be created because of this error:
Error creating core [xmeld_shard1_replica1]: Unable to use updateLog: _version_ field must exist in schema, using indexed="true" or docValues="true", stored="true" and multiValued="false" (_version_ does not exist)
I'm sorry I can't post more details, I'm not too familiar with Solr or with the project itself. Any suggestions or ideas on why this is happening and how to fix it?
EDIT: I changed schema.xml
based on the answer to another question in SO, but the problem persists. Above is the updated version.
Upvotes: 2
Views: 1294
Reputation: 9789
You may be using a cloud mode (though you command line does not seem to point that way). If you do, your schema is stored in Zookeeper instead and putting one on the filesystem does nothing.
Access the Admin UI and look through the various overview pages, paying attention to the path and working directory information. They may be pointing to places different what what you expect. Even if it is not in cloud mode, you may be using shared configuration (configset), which will be reflected in the overview information and possible in core.properties file.
If you are in the cloud mode, read the relevant guide in the reference guide for details on how to update the schema. Though I would not be modifying anything just yet until you know exactly what you have and backed those up.
Upvotes: 0
Reputation: 4519
You should make the stored="true"
in your schema against the _version_
field type, it will definitely start
e.g.
<field name="_version_" type="long" indexed="true" stored="true" />
Upvotes: 3