Hi: Below nested update does not insert a new nested object in the array, 
Notice the added brackets [ ] 


curl -XPOST 'http://localhost:9200/v2/Test/cd196e01/_update'
-d'{"script":"ctx._source.Code += Code",
        "params":{"Code":[{
                "Family":"Family",
                "Code":"Raw",
                "Code":12345,
                "Role":"",
                "Rank":4,
                "Description":"Some updates",
                "SourceType":"human",
                "SourceSequence":1,
                "SourceValue":"some value",
                "Status":"active"
        }]
        }
        }'

Getting error msg:

{"error":"ElasticsearchIllegalArgumentException[failed to execute script];
nested: GroovyScriptExecutionException[ClassCastException[java.util.HashMap
cannot be cast to java.util.Map$Entry]


However, removing the brackets [ ] will update the existing nested object.
Need to insert nested object instead. 

Any help is much appreciated !!

Thank You
 



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/partial-update-and-nested-type-tp3959065p4070003.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1423003635888-4070003.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to