How to Find the size of nested field/ array?

Structure looks like this :

{
"heads": {
"mappings": {
"head": {
"dynamic": "false",
"properties": {
"nestedField1": {
"type": "nested",
"properties": {
"nestedField2": {
"type": "nested",
"properties": {
"field1": {
"type": "keyword"
},
"field2": {
"type": "keyword"
}
}
},
"field3": {
"type": "keyword"
},
"field4": {
"type": "keyword"
},
"field5": {
"type": "keyword"
}
}
}
}
}
}
}
}
What I want is to filter by the size of nestedField2...

Please share the exact query, if possible.
Thanks in advance!

Moved this to the Elasticsearch forum so you will get a better answer.

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