If you write a date range query with numeric parameters we can interpret them as a year. Check it out:
curl -XDELETE -uelastic:password localhost:9200/test
curl -XPOST -HContent-Type:application/json -uelastic:password localhost:9200/test/_doc?refresh -d'{"d": "1970-01-01T00:00:01.010Z"}'
curl -XPOST -HContent-Type:application/json -uelastic:password localhost:9200/test/_doc?refresh -d'{"d": "1967-01-01T00:00:00.000Z"}'
curl -XPOST -HContent-Type:application/json -uelastic:password localhost:9200/test/_search?pretty -d'{
"query": {
"range": {
"d": {
"gt": 1000
}
}
}
}'
The 1000 gets turned into a String internally and then we parse it as the year 1000.
If you write a date range query with numeric parameters we can interpret them as a year. Check it out:
The
1000gets turned into a String internally and then we parse it as the year 1000.