Compare Dates in Script Query

I'm using Painless to create a filter, but when i use two dates this error happens:

"script": "doc['creation_date'].value > doc['update_date'].value",
"lang": "painless",
"caused_by": {
    "type": "class_cast_exception",
    "reason": "Cannot apply [>] operation to types [org.joda.time.MutableDateTime] and [org.joda.time.MutableDateTime]."

This the date type of this fields:

"field_name": {
    "type": "date",
    "index": true,
    "format": "strict_date_time_no_millis"

I need convert this dates to epoch?

Solved: Comparison (<) not supported on datetime fields anymore since upgrade to 6.1

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.