Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.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
Python 从solr 4.5中的多值字段中删除单个值_Python_Solr_Solr4 - Fatal编程技术网

Python 从solr 4.5中的多值字段中删除单个值

Python 从solr 4.5中的多值字段中删除单个值,python,solr,solr4,Python,Solr,Solr4,我是solr的新手。solr查询我得到的数据如下 { "responseHeader": { "status": 0, "QTime": 0, "params": { "indent": "true", "q": "*:*", "_": "1449483445811", "wt": "json", "fq": "id:0553573403" } }, "response": { "nu

我是solr的新手。solr查询我得到的数据如下

{
  "responseHeader": {
    "status": 0,
    "QTime": 0,
    "params": {
      "indent": "true",
      "q": "*:*",
      "_": "1449483445811",
      "wt": "json",
      "fq": "id:0553573403"
    }
  },
  "response": {
    "numFound": 1,
    "start": 0,
    "docs": [
      {
        "id": "0553573403",
        "cat": [
          "book",
          "book1"
        ],
        "name": "Cyberpunk",
        "price": 7.99,
        "price_c": "7.99,USD",
        "inStock": true,
        "author": "George R.R. Martin",
        "author_s": "George R.R. Martin",
        "series_t": "A Song of Ice and Fire",
        "sequence_i": 1,
        "genre_s": "fantasy1111",
        "labelRequest_j_12536_matching_profile": "1",
        "_version_": 1519893543721631700
      }
    ]
  }
}
schema.xml是

   <field name="cat" type="string" indexed="true" stored="true" multiValued="true"/>
然后回应

{"responseHeader":{"status":0,"QTime":616}}

但是它没有删除数据。

我想
id
是您的
uniqueKey
字段

直到Solr 4.9,删除更新选项才可用,请参阅

我想您必须像这样覆盖整个字段值列表:

{
    "id"       : "0553573403",
    "cat"      : {"set":["book1"]}
}

Thanx Simon,但这不是一种正确的方法。这里首先获取数据,然后删除该文本,然后再次在solr中设置数据
{
    "id"       : "0553573403",
    "cat"      : {"set":["book1"]}
}