# Drill down and actually retrieving documents using aggregations

**URL:** <https://discuss.elastic.co/t/drill-down-and-actually-retrieving-documents-using-aggregations/16856>\
**Category:** Elasticsearch\
**Created:** [April 7, 2014, 8:36pm UTC](https://discuss.elastic.co/t/drill-down-and-actually-retrieving-documents-using-aggregations/16856 "2014-04-07T20:36:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![knacktus](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@knacktus](https://discuss.elastic.co/u/knacktus)\
**Post date:** [April 7, 2014, 8:36pm UTC](https://discuss.elastic.co/t/drill-down-and-actually-retrieving-documents-using-aggregations/16856/1 "2014-04-07T20:36:20Z")

</div>

Hi all,

I'm not sure if I've got the correct understanding about using aggregations:

With bucket aggregations I can give the user hints about what values for a  
given field are available and how many documents match the value. So far,  
so good. But then we need to work with the documents of the buckets. My  
understanding is that to retrieve the documents of the buckets I would have  
to perform another query, wouldn't I? For nested buckets: Would I need to  
assemble a complex query based on the results of the aggregation?

Or do I miss some obvious technique how to handle the documents of the  
buckets? Like, get the id field?

Thanks,

Jan

--  
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/a682e538-06fa-485c-8926-5687a33714ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a682e538-06fa-485c-8926-5687a33714ab%40googlegroups.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:37am UTC](https://discuss.elastic.co/t/drill-down-and-actually-retrieving-documents-using-aggregations/16856/2 "2017-07-06T01:37:46Z")

</div>


