在原子更新后,DIH索引编制不会更新文档

时间:2019-05-21 05:50:08

标签: solr

我正在使用Solr 8.0.0,使用DIH的索引首次可以正常工作。

DIH请求格式:

网址: http://localhost:8983/solr/LatestDemo1/dataimport?command=full-import&Person=1,2,3&entity=Person&commit=true&clean=false

在DIH之后为数据编制索引:

response":{"numFound":2,"start":0,"docs":[
  {
    "id":"P1",
    "Name":"Tom",
    "LastName":"Albert",
    "Gender":"M",
    "Age":"25"
  },
  {
    "id":"P2",
    "Name":"Jack",
    "LastName":"Albert",
    "Gender":"M",
    "Age":"20"
  },
]}

使用Solr API使用原子更新进行更新

网址:http://localhost:8983/solr/LatestDemo1/update?commit=true

方法:发布

数据:

[
    {
     "id":"P1",
     "Age":{"set":"25"}
    },
    {
     "id":"P1",
     "Age":{"set":"20"}
    },
]

在原子更新后为数据编制索引:

response":{"numFound":2,"start":0,"docs":[
  {
    "id":"P1",
    "Name":"Tom",
    "LastName":"Albert",
    "Gender":"M",
    "Age":"25"
  },
  {
    "id":"P2",
    "Name":"Jack",
    "LastName":"Albert",
    "Gender":"M",
    "Age":"20"
  },
]}

因此,再次使用DIH执行索引编制后,它将删除通过原子更新和文档外观如下所示的Age Field记录:

response":{"numFound":2,"start":0,"docs":[
  {
    "id":"P1",
    "Name":"Tom",
    "LastName":"Albert",
    "Gender":"M"
  },
  {
    "id":"P2",
    "Name":"Jack",
    "LastName":"Albert",
    "Gender":"M"
  },
]}

因此,使用DIH进行索引编制后,不应删除由原子更新更新的我的年龄字段

任何建议都将受到赞赏。。谢谢。

0 个答案:

没有答案