# Where is the timestamp or where is the problem on my mapping definition "\_timestamp"?

**URL:** https://discuss.elastic.co/t/where-is-the-timestamp-or-where-is-the-problem-on-my-mapping-definition--timestamp/14361
**Category:** Elasticsearch
**Created:** [November 12, 2013, 8:22am UTC](https://discuss.elastic.co/t/where-is-the-timestamp-or-where-is-the-problem-on-my-mapping-definition--timestamp/14361 "2013-11-12T08:22:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pablo3027](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pablo3027](https://discuss.elastic.co/u/pablo3027)
#### Post date: [November 12, 2013, 8:22am UTC](https://discuss.elastic.co/t/where-is-the-timestamp-or-where-is-the-problem-on-my-mapping-definition--timestamp/14361/1 "2013-11-12T08:22:49Z")

</div>

I define a new mapping to try this option... but the timestamp its not  
saved atomatically with the post of the document

My mapping definition :

curl -XPUT "[http://localhost:9200/indice/tweet/\_mapping](http://localhost:9200/indice/tweet/_mapping)" -d'  
{  
"tweet": {  
"properties": {  
"message": {  
"type": "string"  
},  
"user": {  
"type": "string"  
},  
"post\_date": {  
"type": "date"  
}  
},  
"\_timestamp" :  
{  
"enabled":true,  
"store": "yes",  
"path" : "post\_date",  
"format" : "yyyy-MM-dd HH:mm:ss"  
}  
}  
}'

* * *

When i store a document i supose that this timestamp its going to be stored  
with the elasticsearch server date-time

## curl -XPUT "[http://localhost:9200/indice/tweet/1](http://localhost:9200/indice/tweet/1)" -d' { "tweet": { "message" :"Prueba alta", "user" : "Pablo" } }'

But nothing of this...... why????

curl -XGET "[http://localhost:9200/indice/tweet/1](http://localhost:9200/indice/tweet/1)"

{  
"\_index": "indice",  
"\_type": "tweet",  
"\_id": "1",  
"\_version": 5,  
"exists": true,  
"\_source": {  
"tweet": {  
"message": "Prueba alta",  
"user": "Pablo"  
}  
}  
}

Thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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: [November 12, 2013, 8:33am UTC](https://discuss.elastic.co/t/where-is-the-timestamp-or-where-is-the-problem-on-my-mapping-definition--timestamp/14361/2 "2013-11-12T08:33:50Z")

</div>

Elasticsearch never modifies your \_source document.  
That's the reason you don't have an updated document when you GET it.

But, you can search for it and as you stored the timestamp field, you probably can get it using field=\_timestamp

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)

{  
"fields" : ["\_source", "\_timestamp"]  
}

Makes sense?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

12 novembre 2013 at 09:22:56, Pablo Blasco ([pablo3027@gmail.com](mailto:pablo3027@gmail.com)) a écrit:

I define a new mapping to try this option... but the timestamp its not saved atomatically with the post of the document

My mapping definition :

curl -XPUT "[http://localhost:9200/indice/tweet/\_mapping](http://localhost:9200/indice/tweet/_mapping)" -d'  
{  
"tweet": {  
"properties": {  
"message": {  
"type": "string"  
},  
"user": {  
"type": "string"  
},  
"post\_date": {  
"type": "date"  
}  
},  
"\_timestamp" :  
{  
"enabled":true,  
"store": "yes",  
"path" : "post\_date",  
"format" : "yyyy-MM-dd HH:mm:ss"  
}  
}  
}'

* * *

When i store a document i supose that this timestamp its going to be stored with the elasticsearch server date-time

## curl -XPUT "[http://localhost:9200/indice/tweet/1](http://localhost:9200/indice/tweet/1)" -d' { "tweet": { "message" :"Prueba alta", "user" : "Pablo" } }'

But nothing of this...... why????

curl -XGET "[http://localhost:9200/indice/tweet/1](http://localhost:9200/indice/tweet/1)"

{  
"\_index": "indice",  
"\_type": "tweet",  
"\_id": "1",  
"\_version": 5,  
"exists": true,  
"\_source": {  
"tweet": {  
"message": "Prueba alta",  
"user": "Pablo"  
}  
}  
}

## Thanks

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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![pablo3027](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pablo3027](https://discuss.elastic.co/u/pablo3027)
#### Post date: [November 12, 2013, 8:41am UTC](https://discuss.elastic.co/t/where-is-the-timestamp-or-where-is-the-problem-on-my-mapping-definition--timestamp/14361/3 "2013-11-12T08:41:45Z")

</div>

Great!! thanks

2013/11/12 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

> Elasticsearch never modifies your \_source document.  
> That's the reason you don't have an updated document when you GET it.
> 
> But, you can search for it and as you stored the timestamp field, you  
> probably can get it using field=\_timestamp
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)
> 
> {  
> "fields" : ["\_source", "\_timestamp"]  
> }
> 
> Makes sense?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> 12 novembre 2013 at 09:22:56, Pablo Blasco ([pablo3027@gmail.com](mailto:pablo3027@gmail.com)//pablo3027@gmail.com)  
> a écrit:
> 
> I define a new mapping to try this option... but the timestamp its not  
> saved atomatically with the post of the document
> 
> My mapping definition :
> 
> curl -XPUT "[http://localhost:9200/indice/tweet/\_mapping](http://localhost:9200/indice/tweet/_mapping)" -d'  
> {  
> "tweet": {  
> "properties": {  
> "message": {  
> "type": "string"  
> },  
> "user": {  
> "type": "string"  
> },  
> "post\_date": {  
> "type": "date"  
> }  
> },  
> "\_timestamp" :  
> {  
> "enabled":true,  
> "store": "yes",  
> "path" : "post\_date",  
> "format" : "yyyy-MM-dd HH:mm:ss"  
> }  
> }  
> }'
> 
> * * *
> 
> When i store a document i supose that this timestamp its going to be  
> stored with the elasticsearch server date-time
> 
> ## curl -XPUT "[http://localhost:9200/indice/tweet/1](http://localhost:9200/indice/tweet/1)" -d' { "tweet": { "message" :"Prueba alta", "user" : "Pablo" } }'
> 
> But nothing of this...... why????
> 
> curl -XGET "[http://localhost:9200/indice/tweet/1](http://localhost:9200/indice/tweet/1)"
> 
> {  
> "\_index": "indice",  
> "\_type": "tweet",  
> "\_id": "1",  
> "\_version": 5,  
> "exists": true,  
> "\_source": {  
> "tweet": {  
> "message": "Prueba alta",  
> "user": "Pablo"  
> }  
> }  
> }
> 
> ## Thanks
> 
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/bCCvDVBw6RU/unsubscribe](https://groups.google.com/d/topic/elasticsearch/bCCvDVBw6RU/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Saludos,  
Pablo Blasco Martinavarro.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:07am UTC](https://discuss.elastic.co/t/where-is-the-timestamp-or-where-is-the-problem-on-my-mapping-definition--timestamp/14361/4 "2017-07-06T02:07:44Z")

</div>


