Hi,
I need a help on the query where I want to search by phone numbers and get latest date amount charged for that phone number
my mapping structure is as follows
"mappings":{
"phone_list":{
"properties":{
"phone":{
"type":"text"
}
"amount":{
"type":"integer"
}
"date_timestamp":{
"type":"text"
}
}
}
}
I have performed a query which gives the latest date_timestamp of a particular phone number . As follows
{
"query":{
"match":{
"phone":"1234567890"
}
},
"aggs":{
"latest_call_date&time":{
"max":{
"field":"date_timestamp"
}
}
}
}
Now how can I achieve the amount related to the date_timestamp returned by aggregation function max.