# Filtering by Number of Nested Objects

**URL:** <https://discuss.elastic.co/t/filtering-by-number-of-nested-objects/72375>\
**Category:** Elasticsearch\
**Created:** [January 21, 2017, 8:29pm UTC](https://discuss.elastic.co/t/filtering-by-number-of-nested-objects/72375 "2017-01-21T20:29:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GyllingSW](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@GyllingSW](https://discuss.elastic.co/u/GyllingSW)\
**Post date:** [January 23, 2017, 11:56am UTC](https://discuss.elastic.co/t/filtering-by-number-of-nested-objects/72375/2 "2017-01-23T11:56:00Z")

</div>

Try to see if this issue would do the trick:

> [@Scripted filter on nested field](https://discuss.elastic.co/t/scripted-filter-on-nested-field/27162):
>
> I have to filter documents based on scripted value of nested element. My data structure looks like this: { "product-group-name" : "group1" "products": [{ "name" : "product1" "price" : 10 },{ "name" : "product2" "price" : 20 }] } "products" is nested field. Now I need to find product groups (top level documents) where one of the nested "price" fields satisfy condition I define with the script (I have complex script expression that can not be replaced with simple nested q…

---

_[View the full topic](https://discuss.elastic.co/t/filtering-by-number-of-nested-objects/72375)._
