Hi i'm facing an error during update nested field this is the following info on my setup:
my index has this structure:
{
"mappings": {
"profile": {
"properties": {
"account": {
"properties": {
"username": {
"type": "text"
},
"password": {
"type": "text"
},
"email": {
"type": "text"
},
"isAdmin": {
"type": "boolean"
},
"isActive": {
"type": "boolean"
},
"last_activity": {
"type": "date"
},
"isPaymentSet": {
"type": "boolean"
},
"isBillingSet": {
"type": "boolean"
},
"isDetailSet": {
"type": "boolean"
}
}
},
"staff": {
"type": "nested",
"properties": {
"fname": {
"type": "text"
},
"lname": {
"type": "text"
},
"position": {
"type": "text"
},
"bio": {
"type": "text"
},
"avatar": {
"type": "text"
}
}
}
}
}
}
}
document inserted body:
{
"region": "AU",
"account": {
"username": account['username'],
"password": account['password'],
"email": account['email'],
"isAdmin": False,
"isActive": True,
"isPayment": False,
"isBilling": False,
"isDetail": False,
"last_activity": "2017-07-07"
},
"customer": [
{
"firstname": customer['firstname'],
"lastname": customer['lastname'],
"strip" : "",
"address" : "",
"company" : "",
"street" : "",
"street_2" : "",
"city" : "",
"state" : "",
"zip" : "",
"country" : "",
}
]}
with that i'm trying to update a field of zip under the customer is it possible to achieve that i had tried this Update query:
{
"script": {
"inline": "ctx._source.customer.add(params.zip)",
"params": {
"customer": {
"zip": "hello"
}
}
}
}
the response:
HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 147
{"_index":"account","_type":"profile","_id":"AVzt5KpDxjBnZ439EbPh","_version":6,"result":"updated","_shards":{"total":2,"successful":1,"failed":0}}
but there is no update for the zip field, please help