# From ES aggregation result to a List of Maps (Java)

**URL:** <https://discuss.elastic.co/t/from-es-aggregation-result-to-a-list-of-maps-java/22393>\
**Category:** Elasticsearch\
**Created:** [February 25, 2015, 10:09pm UTC](https://discuss.elastic.co/t/from-es-aggregation-result-to-a-list-of-maps-java/22393 "2015-02-25T22:09:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sven\_Jorns](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@Sven\_Jorns](https://discuss.elastic.co/u/Sven_Jorns)\
**Post date:** [February 25, 2015, 10:09pm UTC](https://discuss.elastic.co/t/from-es-aggregation-result-to-a-list-of-maps-java/22393/1 "2015-02-25T22:09:59Z")

</div>

Hi,

what is the best way to convert an ES Aggregation result to a List of Maps  
in Java using Java API?

I want to display the results into a pivot-table or in the first step just  
print out the filled rows into the console.

Thanks  
Sven

--  
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/5c172b60-602c-44d5-9ae7-e57949b01bf1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5c172b60-602c-44d5-9ae7-e57949b01bf1%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:** [February 26, 2015, 11:22pm UTC](https://discuss.elastic.co/t/from-es-aggregation-result-to-a-list-of-maps-java/22393/2 "2015-02-26T23:22:33Z")

</div>

There is no automatic way to do that. I believe you need to have special  
handling of this on client side for the aggregations that you plan to  
support.

On Wed, Feb 25, 2015 at 11:09 PM, Sven Jörns [sj.at.soit@gmail.com](mailto:sj.at.soit@gmail.com) wrote:

> Hi,
> 
> what is the best way to convert an ES Aggregation result to a List of Maps  
> in Java using Java API?
> 
> I want to display the results into a pivot-table or in the first step just  
> print out the filled rows into the console.
> 
> Thanks  
> Sven
> 
> --  
> 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/5c172b60-602c-44d5-9ae7-e57949b01bf1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5c172b60-602c-44d5-9ae7-e57949b01bf1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/5c172b60-602c-44d5-9ae7-e57949b01bf1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5c172b60-602c-44d5-9ae7-e57949b01bf1%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/CAL6Z4j5diNS05BsSnP6bB7MzaeMgS1yhtiYfOC8E9ZAkbx5LKw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5diNS05BsSnP6bB7MzaeMgS1yhtiYfOC8E9ZAkbx5LKw%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, 12:29am UTC](https://discuss.elastic.co/t/from-es-aggregation-result-to-a-list-of-maps-java/22393/3 "2017-07-06T00:29:42Z")

</div>

Closed on July 6, 2017, 12:29am UTC


