I'm Trying to search for all the items who have a field of date inside a range, and it fails (returns no results)
The query:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"range": {
"last_updated": {
"from": "2013-01-01 00:00:00"
}
}
}
}
}
}
The mapping:
{
"my_doctype": {
"_timestamp": {
"enabled": "true"
},
"properties": {
"cards": {
"type": "integer"
},
"last_updated": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
}
}
}
}
results in:
{
took: 1
timed_out: false
_shards: {
total: 1
successful: 1
failed: 0
}
hits: {
total: 0
max_score: null
hits: [ ]
}
}
The same query filtered by a range for an integer field("cards") with a numeric value works fine.
Changing the date to a very early start (1900-01-01 00:00:00) also shows no results.
What am I doing wrong?
BTW, I know I have the _timestamp enabled in the mapping, but that is not the field I am filtering by.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…