我对solr文档更新有疑问。例如,当两个同时出现更新solr文档的请求时,solr如何工作?
先谢谢
答案 0 :(得分:1)
Lucene locking factory docs中提到了不同的锁定机制。默认情况下,使用NativeFSLockFactory,为正在编制索引的文档获取文件锁。可以在solrconfig.xml
中更改使用其他锁定机制的设置以下是solconfig.xml
的摘录<!-- LockFactory
This option specifies which Lucene LockFactory implementation
to use.
single = SingleInstanceLockFactory - suggested for a
read-only index or when there is no possibility of
another process trying to modify the index.
native = NativeFSLockFactory - uses OS native file locking.
Do not use when multiple solr webapps in the same
JVM are attempting to share a single index.
simple = SimpleFSLockFactory - uses a plain file for locking
Defaults: 'native' is default for Solr3.6 and later, otherwise
'simple' is the default
More details on the nuances of each LockFactory...
http://wiki.apache.org/lucene-java/AvailableLockFactories
-->
<lockType>${solr.lock.type:native}</lockType>
答案 1 :(得分:1)
您在谈论物理锁或逻辑版本控制吗?对于逻辑版本控制,Solr 4+使用 version 字段支持乐观并发。
你可以阅读它: