Unable to filter query by _timestamp


(Alice) #1

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)


(system) #2