# How can I get full document from term aggregation on a specific field?

**URL:** <https://discuss.elastic.co/t/how-can-i-get-full-document-from-term-aggregation-on-a-specific-field/67394>\
**Category:** Elasticsearch\
**Created:** [November 28, 2016, 7:58pm UTC](https://discuss.elastic.co/t/how-can-i-get-full-document-from-term-aggregation-on-a-specific-field/67394 "2016-11-28T19:58:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g\_dev](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@g\_dev](https://discuss.elastic.co/u/g_dev)\
**Post date:** [November 28, 2016, 7:58pm UTC](https://discuss.elastic.co/t/how-can-i-get-full-document-from-term-aggregation-on-a-specific-field/67394/1 "2016-11-28T19:58:09Z")

</div>

I'm doing a term aggregation on my documents which is giving me field name and count of it, and top of it I'm applying sub aggregation to get me document with latest time-stamp, which is working as expected.  
But how can I get full document associated to the result?

---

<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 26, 2016, 7:58pm UTC](https://discuss.elastic.co/t/how-can-i-get-full-document-from-term-aggregation-on-a-specific-field/67394/2 "2016-12-26T19:58:36Z")

</div>

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