Hi Guys !
I have a document which contains an array of JSONObject.
When I add a JSONObject in my array from Sense like this, it works fine :
[quote] POST index/type/1/_update
{
"script" : {
"inline": "ctx._source.people.add(params.person)",
"lang": "painless",
"params" : {
"person" : {
"field" : "test"
}
}
}
}
[/quote]
But when I'm trying to add throw the Java Api with this code :
I got the following error : java.io.IOException: can not write type [class org.json.JSONObject]
I tried to replace the JSONObject with a XContentBuilder but the same exception is throwing...
Can anyone has an explenation or an idea how I can fix this ?