I have the following mapping.
curl -XPUT http://localhost:9200/cstest/ -d '
{
"mappings": {
"csproducts" : {
"properties" : {
"productid":{
"type" : "String"
},
"category":{
"type": "string",
"null_value" : "N/A"
}
} //end properties
} //end csproducts
} //end mapping
}
'
Data:
curl -XPUT 'http://localhost:9200/cstest/csproducts/1' -d '
{
"productid":"1",
"category":"software"
}'
I am updating the document with the following
curl -XPOST 'http://localhost:9200/cstest/csproducts/1' -d'
{
"script" : "ctx._source.category+=new_category",
"params" : {
"new_category" : "development"
}
}'
I need to insert another category called "development" to the the category array.
This does not seem to be working. Any idea how to do it?