i have index in es and this is the corresponding mapping :
'''
GET /vid_detect2/_mapping
{
"properties": {
"date":{"type":"date"},
"time":{ "type": "text",
"fielddata": true},
"frame_id": {"type":"integer"},
"camera_id":{"type":"integer"},
"path":{"type":"text"},
"objects" : {"type": "nested",
"properties": {
"class": { "type": "text" ,"fielddata":true },
"confidence": { "type": "float" },
"coordinates":{ "type": "nested" ,
"properties": { "x" :{"type":"float"},
"y" :{"type":"float"},
"w" :{"type":"float"},
"h" :{"type":"float"}
} }
}
}
}
}'''
I want to run following query first :
"query": {
"bool": {
"must": [
{
"nested": {
"path": "objects",
"query": {
"bool": {
"must": [
{ "match": { "objects.class": "person" }}
]
}}}}
]
}}
and then aggregate the returned results with respect to camera_id and further aggregate those aggregated results with date histogram. Please help.