17

我的 solr 配置出现以下错误。

Caused by: org.apache.solr.common.SolrException: Unable to use updateLog: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:806)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:619)
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:1021)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1051)
        ... 10 more
Caused by: org.apache.solr.common.SolrException: Unable to use updateLog: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist)
        at org.apache.solr.update.UpdateLog.init(UpdateLog.java:245)
        at org.apache.solr.update.UpdateHandler.initLog(UpdateHandler.java:84)
        at org.apache.solr.update.UpdateHandler.<init>(UpdateHandler.java:134)
        at org.apache.solr.update.DirectUpdateHandler2.<init>(DirectUpdateHandler2.java:95)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:526)
        at org.apache.solr.core.SolrCore.createUpdateHandler(SolrCore.java:597)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:790)
        ... 13 more
Caused by: org.apache.solr.common.SolrException: _version_field must exist in schema, using indexed="true" stored="true" and multiValued="false" (_version_ does not exist)
        at org.apache.solr.update.VersionInfo.getAndCheckVersionField(VersionInfo.java:57)
        at org.apache.solr.update.VersionInfo.<init>(VersionInfo.java:83)
        at org.apache.solr.update.UpdateLog.init(UpdateLog.java:242)
        ... 23 more

我想知道它是什么_version_field,为什么它必须是必需的?

有人可以建议我吗?

4

3 回答 3

28

在 schema.xml 的“field”标签内添加以下字段定义

<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
于 2013-07-18T12:51:36.537 回答
20

_version_字段是由部分更新过程、更新日志过程和 SolrCloud 使用的内部字段。它仅在内部用于这些进程,只需_version_在 schema.xml 中提供该字段就足够了。

_version_如果您想了解有关_version_.

于 2013-03-22T23:11:34.023 回答
1

如果删除它,还必须从 solrconfig.xml 中删除事务日志记录。请参阅链接

于 2014-07-22T09:17:07.240 回答