# Retrieving \_timestamp

**URL:** https://discuss.elastic.co/t/retrieving--timestamp/16466
**Category:** Elasticsearch
**Created:** [March 19, 2014, 2:01pm UTC](https://discuss.elastic.co/t/retrieving--timestamp/16466 "2014-03-19T14:01:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nishidha\_randad](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nishidha\_randad](https://discuss.elastic.co/u/nishidha_randad)
#### Post date: [March 19, 2014, 2:01pm UTC](https://discuss.elastic.co/t/retrieving--timestamp/16466/1 "2014-03-19T14:01:35Z")

</div>

Hi,

I've been facing an issue retrieving \_timestamp for one of my indices.  
Below is the mapping of my index -

"my\_index\_1": {  
"settings": {  
"index": {  
"number\_of\_shards": 4,  
"number\_of\_replicas": 1  
},  
"aliases": [  
"my\_index"  
]  
},  
"mappings": {  
"my\_index\_type": {  
"\_all": {  
"enabled": False  
},  
"\_timestamp": {  
"enabled": True,  
"store": True  
},  
"properties": {  
...  
}  
}  
}  
}

I'm using below query to get all documents updated after certain timestamp  
(xyz in miliseconds) -  
{  
"fields": [  
"\_timestamp",  
"\_source"  
],  
"query": {  
"filtered": {  
"query": {  
"match\_all": {}  
},  
"filter": {  
"range": {  
"\_timestamp": {  
"gte": xyz  
}  
}  
}  
}  
}  
}

But this is returning me all the documents in my index including the ones  
that are not updated after xyz time and moreover, in the output, I don't  
see \_timestamp field. Kindly help me with this issue. Also, note that I  
cannot change the mapping of my index.

Thanks in advance,  
Nishidha

--  
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/f38290a5-5ed3-493f-b031-957a11137d28%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f38290a5-5ed3-493f-b031-957a11137d28%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![nishidha\_randad](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nishidha\_randad](https://discuss.elastic.co/u/nishidha_randad)
#### Post date: [March 21, 2014, 4:39am UTC](https://discuss.elastic.co/t/retrieving--timestamp/16466/2 "2014-03-21T04:39:13Z")

</div>

I've got the issue and solution. In above mapping specified, \_all \> enabled  
should be True in order to enable \_timestamp and store it.  
Hence, closing the post.

On Wednesday, 19 March 2014 19:31:35 UTC+5:30, nishidha randad wrote:

> Hi,
> 
> I've been facing an issue retrieving \_timestamp for one of my indices.  
> Below is the mapping of my index -
> 
> "my\_index\_1": {  
> "settings": {  
> "index": {  
> "number\_of\_shards": 4,  
> "number\_of\_replicas": 1  
> },  
> "aliases": [  
> "my\_index"  
> ]  
> },  
> "mappings": {  
> "my\_index\_type": {  
> "\_all": {  
> "enabled": False  
> },  
> "\_timestamp": {  
> "enabled": True,  
> "store": True  
> },  
> "properties": {  
> ...  
> }  
> }  
> }  
> }
> 
> I'm using below query to get all documents updated after certain timestamp  
> (xyz in miliseconds) -  
> {  
> "fields": [  
> "\_timestamp",  
> "\_source"  
> ],  
> "query": {  
> "filtered": {  
> "query": {  
> "match\_all": {}  
> },  
> "filter": {  
> "range": {  
> "\_timestamp": {  
> "gte": xyz  
> }  
> }  
> }  
> }  
> }  
> }
> 
> But this is returning me all the documents in my index including the ones  
> that are not updated after xyz time and moreover, in the output, I don't  
> see \_timestamp field. Kindly help me with this issue. Also, note that I  
> cannot change the mapping of my index.
> 
> Thanks in advance,  
> Nishidha

--  
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/b9a324d2-3c6a-49fc-af72-3b9663a2f9a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b9a324d2-3c6a-49fc-af72-3b9663a2f9a0%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:41am UTC](https://discuss.elastic.co/t/retrieving--timestamp/16466/3 "2017-07-06T01:41:43Z")

</div>


