# Keeping original creation date on updates

**URL:** https://discuss.elastic.co/t/keeping-original-creation-date-on-updates/16870
**Category:** Elasticsearch
**Created:** [April 8, 2014, 9:19am UTC](https://discuss.elastic.co/t/keeping-original-creation-date-on-updates/16870 "2014-04-08T09:19:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dennis\_de\_Boer](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@Dennis\_de\_Boer](https://discuss.elastic.co/u/Dennis_de_Boer)
#### Post date: [April 8, 2014, 9:19am UTC](https://discuss.elastic.co/t/keeping-original-creation-date-on-updates/16870/1 "2014-04-08T09:19:32Z")

</div>

Hi all,

I'm running an ecommerce site with elasticsearch and want to add a "new  
items this week" feature.  
I need to add a creation date for every document, but I cannot make it work.

The situation is as follows:

1. The products of the site are imported every day using a JSON datafeed
2. The import of the next day will overwrite the old products/documents in  
ES

What I've tried:

1. Enabled the \_timestamp field. This added a timestamp field, but every  
day when the datafeeds are imported, it is overwritten. This is the case  
for client.prepareIndex() and client.prepareUpdate()
2. Used the 'upsert' command to add a creation date. Since I do not know  
which product is updated/deleted or new in the feed I also have to use  
doc\_as\_upsert. The result is that the upsert command is not executed.
3. I cannot add the creation date to the product myself, since everyday all  
the documents in the index will be overwritten when the datafeed is  
imported.

My Question: Is it possible to have a creation date of a document persist  
on updates?

I'm using Elasticsearch version 0.90.5

Regards,  
Dennis

--  
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/7d7d5609-8e4b-4c95-85e7-45ab3817f364%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d7d5609-8e4b-4c95-85e7-45ab3817f364%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/keeping-original-creation-date-on-updates/16870/2 "2017-07-06T01:37:36Z")

</div>


