2013-03-20 6 views
13

私のsolr設定でエラーが下になりました。Solr 4.2 - _version_fieldとは何ですか?

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であることを知りたいと思った、そしてなぜその必須は必須?

誰でも私にこれを提案できますか?

答えて

14

フィールドは、部分的な更新手順、更新ログ処理、およびSolrCloudによって使用される内部フィールドです。これらのプロセスには内部的にのみ使用され、schema.xmlに_version_フィールドを指定するだけで十分です。

_version_で起こっていることを正確に知りたい場合は、this websiteにアクセスして、_version_を使用する「楽観的同時実行」更新プロセスについて知ることができます。

+0

このフィールドをスキーマに追加することは、インデックスサイズに影響しますか? – Krunal

+0

@Krunal:各文書に余分な属性を追加するとどうなるでしょうか? – ashish

+0

@ashish、これをテストして、インデックスのサイズとパフォーマンスへの影響を理解しました。インデックスサイズやパフォーマンスに大きな変化は見られませんでした。そのため、私たちは将来、部分的な更新をサポートするためにフィールドをスキーマに残すことに決めました。 – Krunal

27

のschema.xmlに

<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/> 
+0

あなたは 'typr =" slong "'を意味すると思います。 'long'はSolr 4.4で動作するようには見えません。 –

+0

実際にバージョンフィールドを事前に定義する必要はありませんでしたが、solrがドキュメントを部分的に更新する機能を追加するときには必須です。 – ashish

+0

@SalvatoreIovene 4.10で 'slong'は機能しませんでした。 – mrmuggles

1

を「フィールド」タグ内の以下のフィールド定義を追加し、あなたがそれを削除した場合、あなたもsolrconfig.xmlからトランザクションログを削除する必要があります。 linkを参照してください。

関連する問題