hi,
i am trying to compute a date difference in a scripted field
if(!doc['lastseen'].empty && !doc['firstseen'].empty) {
return doc['lastseen'].value - doc['firstseen'].value
} else {
return 0
}
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.
