I am new to elasticsearch please help me
Please find the mapping so that I can explain what is the out put required.
PUT /myproject/contact/_mapping
{
"contact": {
"properties": {
"emailid": {
"type" :"text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"phonenumber": {
"type" :"text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"personaladdress":{
"type":"nested",
"properties": {
"city": {
"type": "text",
"fields":{
"keyword": {
"type": "keyword"
}
}
}
}
}
}
}
}
I am looking an aggregation query where it give the out put
City wise (nested doc) how many email / phone number we have
City | Email | Phone number |
Bangalore | 50 | 30 |
Another City | 10 | 5 |