Elasticsearch Updating nested objects

Viewed 2829

I found out the same problem in internet, but i dont understand a solution. The problem is, how can i update a nestend document without to update all array. Thank you so much.

Here is a nasted document

"links": [
  [
    {
      "note_link_id": "1",
      "user_id": "11",
      "creation": "2016-11-15T11:21:10",
      "modification": "2016-11-15T13:38:04",
      "to_asset": "100",
      "from_asset": "99",
      "comment": "Comment 1."
    },
    {
      "note_link_id": "2",
      "user_id": "11",
      "creation": "2016-11-15T13:37:04",
      "modification": "2016-11-15T13:37:27",
      "to_asset": "101",
      "from_asset": "99",
      "comment": "Comment 2."
    },
    {
      "note_link_id": "3",
      "user_id": "11",
      "creation": "2016-11-15T14:01:27",
      "modification": "2016-11-15T14:02:52",
      "to_asset": "102",
      "from_asset": "99",
      "comment": "Comment 3."
    }
  ]
],

Question: how can i update "note_link_id": "2" and update only comment from "Comment 2" to "blja blja blja"

I repeat, how can i update this array without to updating all fields, like "note_link_id": "1", "note_link_id": "2" and "note_link_id": "3"

Thank you

1 Answers
Related