Iam trying to add a new element(object) to an array

https://pastebin.com/1jnSVVJ7

this has the code which iam referring to and the method starting from LINE_23 is always adding a null to the array list how do i fix this ?

Try this:

POST testing/doc/1/_update
{
  "_id": "1",
  "script": {
    "lang": "painless",
    "source": "ctx._source.speech_number.add(params.speech_number)",
    "params": {
      "speech_number": {"jack":"jac11k"}
    }
  }
}
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.