first seen and last seen are date fields.
When i go to discover i get the following error:
"Courier Fetch: 2 of 5 shards failed."
if i return 0 in the if statement all is fine. The same if i just return doc['firsteen'].value or doc['lastseen'].value.
The field is set to type: number.
to me it seems to me that as soon as i start to do arithmetics on the fields values the discovery breaks.
If you want to do date math in Painless you'll need to cast the field values to date types first. There's a good blog post here which includes some examples of working with dates, and other great Painless tips.
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.