Query on nested array fields

Hi ,

I am trying to query an index in elasticsearch which typically consists of documents of the following structure.

Doc 1 :
{
"group":"pl",
"club":[
{
"name":"Arsenal",
"wins":[
{
"2018":22
},
{
"2019":17
}
]
},
{
"name":"Chelsea",
"wins":[
{
"2018":21
},
{
"2019":20
}
]
}
]
}

Doc 2 :
{
"group":"pl2",
"club":[
{
"name":"Arsenal",
"wins":[
{
"2018":25
},
{
"2019":31
}
]
},
{
"name":"Chelsea",
"wins":[
{
"2018":26
},
{
"2019":24
}
]
}
]
}
Essentially i need to find documents by using the the condition club name = "Arsenal" and wins in 2018 > 25. Can anyone help me with a possible solution for this? Unfortunately i need to keep this structure.

Fortunately found it.. Nesting an nested query inside one, did the trick. Thanks and sorry for the trouble..

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.