# Aggs

**URL:** <https://discuss.elastic.co/t/aggs/17830>\
**Category:** Elasticsearch\
**Created:** [May 30, 2014, 9:43am UTC](https://discuss.elastic.co/t/aggs/17830 "2014-05-30T09:43:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bogdan\_Ilie](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Bogdan\_Ilie](https://discuss.elastic.co/u/Bogdan_Ilie)\
**Post date:** [May 30, 2014, 9:43am UTC](https://discuss.elastic.co/t/aggs/17830/1 "2014-05-30T09:43:37Z")

</div>

Please tell me if it is posible to make dynamic aggregation on all inner  
proprietes of a field, or nested object, because i have many product every  
of this product have different attributes, so there is posible to make  
automatically aggs without knowing before what attributes field are named?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/893c22d0-0153-4424-afdc-10aa7856e5b8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/893c22d0-0153-4424-afdc-10aa7856e5b8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [May 30, 2014, 2:59pm UTC](https://discuss.elastic.co/t/aggs/17830/2 "2014-05-30T14:59:20Z")

</div>

Hi Bogdan,

This is not possible since aggregations require you to provide the fields  
on which to execute aggregations explicitely. An option could be to change  
the way that you model your document to leverage nested documents, so that  
your documents would like  
{  
"properties": [  
{ "name": "key1", "value": "value1" },  
{ "name": "key2", "value": "value2" }  
]  
}

instead of  
{  
"key1": "value1",  
"key2": "value2"  
}

And then Elasticsearch will let you run aggregations on `properties.name`  
and `properties.value`.

On Fri, May 30, 2014 at 11:43 AM, Bogdan Ilie [suportcekaut@gmail.com](mailto:suportcekaut@gmail.com)  
wrote:

> Please tell me if it is posible to make dynamic aggregation on all inner  
> proprietes of a field, or nested object, because i have many product every  
> of this product have different attributes, so there is posible to make  
> automatically aggs without knowing before what attributes field are named?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/893c22d0-0153-4424-afdc-10aa7856e5b8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/893c22d0-0153-4424-afdc-10aa7856e5b8%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/893c22d0-0153-4424-afdc-10aa7856e5b8%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/893c22d0-0153-4424-afdc-10aa7856e5b8%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7ODAJ1PuJSP9G8uEiii3gcANr\_NSuCn9N5AZL0b2x%2BBQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7ODAJ1PuJSP9G8uEiii3gcANr_NSuCn9N5AZL0b2x%2BBQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:25am UTC](https://discuss.elastic.co/t/aggs/17830/3 "2017-07-06T01:25:45Z")

</div>


