My documents have 2 date-type fields: "starttime" and "endtime". I am trying to create a scripted field with the difference, in hours.
In the script box, I have this
Are these actual date type fields in Elasticsearch? If so, this doc page will provide you with a lot of information about working with dates in Painless scripts.
Hmmm. Everything seems to be a little bit of a confusion. The output I got -24,000- was not a float. Apparently it is an integer, 24000. It seems like doc['foo'].value returns milliseconds.
I guess I got confused with the format for decimals (dot vs comma).
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.