I currently have a few date fields that I store as longs (epoch timestamp in seconds). When searching, I simply provide a range query with another timestamp value. This works perfectly since it's just number comparison. However, when I convert these to a "date" type and try to do the same thing, the search returns documents that are outside of the range. Wondering what I'm doing wrong here. Am I not properly specifying the date format? For reference, here is what I'm using in my mapping:
"updated":{
"type":"date",
"numeric_resolution":"seconds"
}
When I look at my mapping, I see that Elasticsearch assigned this a format of "dateOptionalTime".