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


(Sundeep) #1

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 ?


(Igor Motov) #2

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"}
    }
  }
}

(system) #3

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