# images field type is nested
GET products/_search
{
"track_total_hits": true,
"size": 0,
"aggs": {
"counts": {
"terms": {
"script": "params['_source']['images'].size()",
"size": 10
}
}
}
}
Last active
June 23, 2023 11:58
-
-
Save hkulekci/694e042b547939397e847c7c99b1ecdd to your computer and use it in GitHub Desktop.
Elasticsearch Nested Array Object Size Aggregation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@pinturic Maybe you can use
value_count
aggregation with fieldimages.id
. I did not try but it could work.