# Unable to filter query by \_timestamp

**URL:** <https://discuss.elastic.co/t/unable-to-filter-query-by--timestamp/63928>\
**Category:** Elasticsearch\
**Created:** [October 25, 2016, 7:30pm UTC](https://discuss.elastic.co/t/unable-to-filter-query-by--timestamp/63928 "2016-10-25T19:30:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![malicemalone](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@malicemalone](https://discuss.elastic.co/u/malicemalone)\
**Post date:** [October 25, 2016, 7:30pm UTC](https://discuss.elastic.co/t/unable-to-filter-query-by--timestamp/63928/1 "2016-10-25T19:30:15Z")

</div>

I'm trying to do a simple query that will return all results that match a range of timestamps. I'm using ‘bool’ to filter with 'range'. However, going off the example I found on the docs, this is not working for me and I’m having a hard time understanding why.

Here is my mapping:

{  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 0  
},  
"mappings": {  
"group": {  
"\_id": {  
"path": "key"  
},  
"properties": {  
"key": {  
"type": "string"  
},  
"mongo\_id": {  
"type": "string"  
},  
"name": {  
"type": "string"  
},  
"desc": {  
"type": "string"  
},  
"productsList": {  
"type": "string"  
},  
"active": {  
"type": "boolean"  
},  
"\_timestamp": {  
"type": "date",  
"enabled": true,  
"store": "yes"  
}  
}  
}  
}  
}

In this case I want to return all documenst except those with a \_timestamp of less than 1474830444550. The trace below shows my query, which is still returning a doc that it shouldn't (timestamp: 1473422435272)

![](https://us1.discourse-cdn.com/elastic/original/2X/7/7db1b9c527207e307c6df5107d9983d15fc9f93b.png)

---

<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 5, 2017, 10:09pm UTC](https://discuss.elastic.co/t/unable-to-filter-query-by--timestamp/63928/2 "2017-07-05T22:09:47Z")

</div>


