How I can use filters aggregation on nested type data
mapping as below
{
DocumentId: String, not_analyzed
,Country: String,not_analyzed
,ContentType: String,not_analyzed
,KeyNotes:{type:nested, properties {NoteType:String,NotAnalyzed, NoteName:String,NotAnalyzed, NoteMention:integer,notanalyzed)}
}
I would like to filter aggregation to find Number of documents based on below condition
(NoteType=Type1 and NoteValue=ValueT1) and (NoteType=Type2 and NoteValue=ValueT2) and Country=USA
viz.If the document has Note Type Type1 with value ValueT1 and the document also has Type2 with ValueT2 + document Country is USA.
I'm trying to Filters Aggregation as I have many such runs in combination of inclusive type and values.