# Return selected fields from aggregation?

**URL:** <https://discuss.elastic.co/t/return-selected-fields-from-aggregation/19260>\
**Category:** Elasticsearch\
**Created:** [August 13, 2014, 3:16pm UTC](https://discuss.elastic.co/t/return-selected-fields-from-aggregation/19260 "2014-08-13T15:16:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![project2501](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@project2501](https://discuss.elastic.co/u/project2501)\
**Post date:** [August 13, 2014, 3:16pm UTC](https://discuss.elastic.co/t/return-selected-fields-from-aggregation/19260/1 "2014-08-13T15:16:17Z")

</div>

The old facet DSL was very nice and easy to understand. I could declare  
only which fields I wanted returned.

how is this done with aggregations? The docs do not say.

I am only interested in the aggregation metrics not all the document  
results.

I tried setting "size":0 but that DOES NOT EVEN WORK.

Any help appreciated.

Thank you,  
D

--  
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/2c845104-59c0-4ea4-90a6-551a93dc3f99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2c845104-59c0-4ea4-90a6-551a93dc3f99%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:** [August 18, 2014, 8:22am UTC](https://discuss.elastic.co/t/return-selected-fields-from-aggregation/19260/2 "2014-08-18T08:22:21Z")

</div>

Can you elaborate more on what you are after?

On Wed, Aug 13, 2014 at 5:16 PM, project2501 [darreng5150@gmail.com](mailto:darreng5150@gmail.com) wrote:

> The old facet DSL was very nice and easy to understand. I could declare  
> only which fields I wanted returned.
> 
> how is this done with aggregations? The docs do not say.
> 
> I am only interested in the aggregation metrics not all the document  
> results.
> 
> I tried setting "size":0 but that DOES NOT EVEN WORK.
> 
> Any help appreciated.
> 
> Thank you,  
> D
> 
> --  
> 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/2c845104-59c0-4ea4-90a6-551a93dc3f99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2c845104-59c0-4ea4-90a6-551a93dc3f99%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2c845104-59c0-4ea4-90a6-551a93dc3f99%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2c845104-59c0-4ea4-90a6-551a93dc3f99%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/CAL6Z4j4m%3DLXao3%3Df%2BgV5uMXO\_nLhLq-7fe-JcCh1oKhp2f8jYg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j4m%3DLXao3%3Df%2BgV5uMXO_nLhLq-7fe-JcCh1oKhp2f8jYg%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:08am UTC](https://discuss.elastic.co/t/return-selected-fields-from-aggregation/19260/3 "2017-07-06T01:08:03Z")

</div>


