I am trying to write a query to update or insert a document. The query is given below.
POST /abc/_doc/108/_update
{
"script" : {
"source": """
// some process is done here
""",
"lang": "painless",
"params" : {
**"_source": {**
** "cus": "abcd2"**
** }**
}
},
"scripted_upsert": true,
"upsert": {
"_source": {
** "cus": "abcd2"**
** }**
}
}
I am using the same payload in upsert and inside params
is there a way to use the same payload without writing it twice