This is a field in my document:
My goal is to calculate some value from difference between two datetime fields (e.g. dt1 - dt2)
I running a script to perform such operation:
updateDescriptor.Script(a => a.Inline("ctx._source.lifetime = ctx._source.date_deleted - ctx._source.date_found"));
This operation results with the following error:
"Cannot apply [-] operation to types [java.lang.String] and [java.lang.String]."
How it is advised to perform operations on datetime fields?