# Control freshness of data in Elasticsearch

**URL:** https://discuss.elastic.co/t/control-freshness-of-data-in-elasticsearch/222626
**Category:** Elasticsearch
**Created:** [March 8, 2020, 11:11pm UTC](https://discuss.elastic.co/t/control-freshness-of-data-in-elasticsearch/222626 "2020-03-08T23:11:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)
#### Post date: [March 8, 2020, 11:11pm UTC](https://discuss.elastic.co/t/control-freshness-of-data-in-elasticsearch/222626/1 "2020-03-08T23:11:15Z")

</div>

Hello,

Objective : Compare last data sent by injector with the last document inserted in index ES.

About last document inserted in ES index, how i can show it ?  
In index mapping, we have field called Connect\_time, we can use it to show most recent document.

Thanks for help.

Best Regards

Romain

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 8, 2020, 11:33pm UTC](https://discuss.elastic.co/t/control-freshness-of-data-in-elasticsearch/222626/2 "2020-03-08T23:33:21Z")

</div>

> [@Beuhlet\_Reseau](#):
>
> About last document inserted in ES index, how i can show it ?

There's nothing IMO which does that automatically.  
You can just provide yourself a timestamp set to when you sent the document to elasticsearch.

---

<div class="post-metadata">

### Author: ![theDor](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@theDor](https://discuss.elastic.co/u/theDor)
#### Post date: [March 9, 2020, 9:56am UTC](https://discuss.elastic.co/t/control-freshness-of-data-in-elasticsearch/222626/3 "2020-03-09T09:56:22Z")

</div>

Sort by your Connect\_time fields and size: 1

---

<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: [April 6, 2020, 9:56am UTC](https://discuss.elastic.co/t/control-freshness-of-data-in-elasticsearch/222626/4 "2020-04-06T09:56:28Z")

</div>

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