# Create a POST body for a search

**URL:** <https://discuss.elastic.co/t/create-a-post-body-for-a-search/315201>\
**Category:** Elasticsearch\
**Created:** [September 26, 2022, 6:38pm UTC](https://discuss.elastic.co/t/create-a-post-body-for-a-search/315201 "2022-09-26T18:38:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergio\_vrijk](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Sergio\_vrijk](https://discuss.elastic.co/u/Sergio_vrijk)\
**Post date:** [September 26, 2022, 6:38pm UTC](https://discuss.elastic.co/t/create-a-post-body-for-a-search/315201/1 "2022-09-26T18:38:20Z")

</div>

I would like some help on a query that I am trying. I have three fields in my JSON. The field1.key, field2.key and field3 which has a nest of data1,data2,data3. What I am trying to do is. Get per unique combination of the field1.key and field2.key the full nest of field3. I just want the latest result, not everything. I know that the first path is being done using aggs, however, I don’t know how to fetch only the latest nest of data. Can someone create a body for me?

---

<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:** [October 24, 2022, 6:38pm UTC](https://discuss.elastic.co/t/create-a-post-body-for-a-search/315201/2 "2022-10-24T18:38:59Z")

</div>

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