【发布时间】:2019-08-12 15:04:12
【问题描述】:
我在 kubernetes 中运行一个 solr 集群,我的组织管理我们自己的分片,而不是让 solr 自动分发文档。因此,我们在solrconfig.xml 中将DistributedUpdateProcessorFactory 替换为NoOpDistributingUpdateProcessorFactory。这发生在我的应用程序代码中,但我可以通过 shell 的简单卷曲重现该行为:
# send an update to a document in shard 0 that adds a value to each field
curl -X POST --header "Content-Type:application/json" --data "[{'id': 'my_doc_id', 'my_field1': {add: ['foo']}, 'my_field2': {add: ['bar']}]" "http://solr-0.solr-headless.default.svc.cluster.local:8983/solr/my_collection/update?commit=false"
# commit the update to the shard (along with updates to other docs I might have sent)
curl -X GET "http://solr-0.solr-headless.default.svc.cluster.local:8983/solr/my_collection/update?commit=true"
其中my_field1 和my_field2 都是多值字符串字段(我基本上想存储从我正在处理的一些数据中提取的字符串列表)。
solr 给出的响应是:
{
"responseHeader":{
"status":400,
"QTime":3},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"RunUpdateProcessor has received an AddUpdateCommand containing a document that appears to still contain Atomic document update operations, most likely because DistributedUpdateProcessorFactory was explicitly disabled from this updateRequestProcessorChain",
"code":400}}
所以我的问题是,为什么在没有分布式更新处理器的情况下禁止原子更新,有没有办法解决这个问题并将原子更新显式发送到各个分片?
【问题讨论】: