Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
solr中同一文档上的多个同时更新_Solr_Commit_Updates - Fatal编程技术网

solr中同一文档上的多个同时更新

solr中同一文档上的多个同时更新,solr,commit,updates,Solr,Commit,Updates,我对solr文档更新有疑问。例如,当两个更新solr中文档的请求同时出现时,solr是如何工作的 它是否随机接受一个请求并在下一个请求到来之前锁定写入 提前感谢中提到了不同的锁定机制。默认情况下,使用NativeFSLockFactory,在该工厂中为正在编制索引的文档获取文件锁。可以在solrconfig.xml中更改使用不同锁定机制的设置 <!-- LockFactory This option specifies which Lucene LockFactory i

我对solr文档更新有疑问。例如,当两个更新solr中文档的请求同时出现时,solr是如何工作的

  • 它是否随机接受一个请求并在下一个请求到来之前锁定写入

提前感谢

中提到了不同的锁定机制。默认情况下,使用NativeFSLockFactory,在该工厂中为正在编制索引的文档获取文件锁。可以在solrconfig.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>
下面是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>

${solr.lock.type:native}

您是在谈论物理锁还是逻辑版本控制?对于逻辑版本控制,Solr 4+支持使用版本字段的乐观并发

您可以阅读以下内容: