Elasticsearch: remove/update field inside nested object

后端 未结 4 1865
借酒劲吻你
借酒劲吻你 2021-01-12 18:36
{
  \"_index\" : \"test\",
  \"_type\" : \"test\",
  \"_id\" : \"1212\",
  \"_version\" : 5,
  \"found\" : true,
  \"_source\" : {
    \"count\" : 42,
    \"list_dat         


        
4条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 19:03

    I don't know why, but I find that

    ctx._source.list_data.removeAll{it.list_id == remove_id}
    

    can't work. Instead I use removeIf like this:

    ctx._source.list_data.removeIf{list_item -> list_item.list_id == remove_id}
    

    where list_item could be arbitrary string.

提交回复
热议问题