I am trying to do an aggregation of the {"wildcard": {"data.addresses.ces.cp": "maria*"}, {"match": { "data.addresses.ces.direction": "rodriguez"}} fields, but it does not return the results of the query.
{
"_source": "created_at",
"size": 1,
"sort": [{
"created_at.keyword": {
"order": "desc"
}
}],
"query": {
"nested": {
"path": "data.addresses",
"inner_hits": {
},
"query": {
"nested": {
"path": "data.addresses.ces",
"query":
{"wildcard": {"data.addresses.ces.cp": "maria*"},
{"match": { "data.addresses.ces.direction": "rodriguez"}}
}
}
}
}
}
How can I perform an aggregation that returns the values of the query, and not all the values of the JSON?
In case the aggregations don't support inner_hits, how could I get wildcard and match in aggs?