# How to get the date when a document got to the index

**URL:** https://discuss.elastic.co/t/how-to-get-the-date-when-a-document-got-to-the-index/3947
**Category:** Elasticsearch
**Created:** [February 18, 2011, 11:15am UTC](https://discuss.elastic.co/t/how-to-get-the-date-when-a-document-got-to-the-index/3947 "2011-02-18T11:15:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ridvan\_Gyundogan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ridvan\_Gyundogan](https://discuss.elastic.co/u/Ridvan_Gyundogan)
#### Post date: [February 18, 2011, 11:15am UTC](https://discuss.elastic.co/t/how-to-get-the-date-when-a-document-got-to-the-index/3947/1 "2011-02-18T11:15:19Z")

</div>

If I put a document to the index, how can I understand when is the  
last date this document has been put to the index.

By put I mean either the date the document was submitted to the index  
or when it was indexed. Either will work for me.

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [February 18, 2011, 11:20am UTC](https://discuss.elastic.co/t/how-to-get-the-date-when-a-document-got-to-the-index/3947/2 "2011-02-18T11:20:05Z")

</div>

On Fri, 2011-02-18 at 03:15 -0800, Ridvan Gyundogan wrote:

> If I put a document to the index, how can I understand when is the  
> last date this document has been put to the index.
> 
> By put I mean either the date the document was submitted to the index  
> or when it was indexed. Either will work for me.

You will need to store a 'last\_modified' field containing the current  
date time as part of the doc.

clint

---

<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, 4:11am UTC](https://discuss.elastic.co/t/how-to-get-the-date-when-a-document-got-to-the-index/3947/3 "2017-07-06T04:11:52Z")

</div>


