There are two types of aggregation: bucket
aggregations and metrics aggregation. Please see the documents to get detail. Bucket aggregation such as date histogram bucket aggregation only divide all documents into some buckets and did not select them. You can use metrics aggregations such as top hits or top metrics aggregation to retrieve some value or documents from each packets.
1 Like