Below is my mapping.I want to sum of payment if their names are equal. And put that in payment field. Then, I want collect data like this.
{
"person" : {
"mappings" : {
"dynamic_templates" : [
{
"strings" : {
"match_mapping_type" : "string",
"mapping" : {
"type" : "keyword"
}
}
}
],
"properties" : {
"userid" : {
"type" : "keyword"
},
"name" : {
"type" : "keyword"
},
"payment" : {
"type" : "keyword",
"fields" : {
"numeric" : {
"type" : "integer"
}
}
}
}
}
}
}
As an example
Index1
userid name payment
1234 Marco 20
2312 Sylvia 50
5653 Ruben 35
1234 Marco 30
Expected Result
Index1
userid name payment
1234 Marco 50
2312 Sylvia 50
5653 Ruben 35