I have following elasticsearch schema, where leaves is a nested field:
{
studentId:123,
studentName:'abc',
leaves:[
{
type:'casual',
date:'2012-12-12'
},
{
type:'sick',
date:'2012-10-08'
}
]
}
I want to filter/query the students having at least 2 holidays where holiday type is 'casual'.Just filter the documents, no aggregation required. Have seen the question below which is old and uses deprecated 'filtered' query. elastic search filter by documents count in nested document
My Elasticsearch version is 7.5