# Elasticsearch nested aggregation filters - product catalog

**URL:** <https://discuss.elastic.co/t/elasticsearch-nested-aggregation-filters-product-catalog/66144>\
**Category:** Elasticsearch\
**Created:** [November 15, 2016, 6:16pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-aggregation-filters-product-catalog/66144 "2016-11-15T18:16:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![igerko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igerko/32/124892_2.png) [@igerko](https://discuss.elastic.co/u/igerko)\
**Post date:** [November 15, 2016, 6:16pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-aggregation-filters-product-catalog/66144/1 "2016-11-15T18:16:22Z")

</div>

I have following objects in my elasticsearch index and I want to create aggregations based on option\_groups\_value. This is described here in last snippet of this post [http://distinctplace.com/2014/07/29/build-zappos-like-products-facets-with-elasticsearch/](http://distinctplace.com/2014/07/29/build-zappos-like-products-facets-with-elasticsearch/)

```
[
    {
    id: 1,
    "option_groups_value": [
        {
          "group": "color",
          "option": "black",
        },
        {
          "group": "material",
          "option": "wood",
        },
        ...
      ]
    ...
},
...
   ]

```

I created aggregations, but there are missing that conditions, that are described in last section. here

```
"aggs": {
    "option_groups_value": {
      "nested": {
        "path": "option_groups_value"
      },
      "aggs": {
        "group": {
          "aggs": {
            "value": {
              "terms": {
                "size": 40,
                "field": "option_groups_value.option.raw"
              }
            }
          },
          "terms": {
            "size": 40,
            "field": "option_groups_value.group.raw"
          }
        }
      }
    }
  }

```

How can I include that filters in my aggregations ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 13, 2016, 6:16pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-aggregation-filters-product-catalog/66144/2 "2016-12-13T18:16:34Z")

</div>

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