One of the fields in the ES that my team used is "TIME_STAMP" which contains a timestamp data but in keyword format. I want to query data based on this value, is there any way to convert the keyword to date? I'm new to ES stuff, so please don't get mad with me.
Without create another field to store TIME_STAMP in date (or timestamp) format, is it possible to convert the datatype within the query?
As for why not stores in timestamp format in the first place (as I saw this mentioned in many posts), I don't know, when I joined the team, the field is there, and it seems I cannot change it myself.
If you want to be able to search without creating a runtime mapping each time, you can create a new sup component called timestamp.data. Note you will have to reindex your data if you do the second method.
I tried your first method, it first found a formatting error but after looking at the error cause, I tried adding formatter.withZone(ZoneId.of('GMT+7')) in formatter param and it works like a charm!
I'll look into the second method for a long-term solution.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.