Lucene expressions script - date comparison, boolean


(Shawn Johnson) #1

I'm trying to use a lucene expressions for a scripted field to compare dates. It appears to be working, but the values are returned as 1/0 instead of true/false. Is this the expected behavior? Is there an alternative approach?

Note: I would be fine with 1/0, but I'm running into mapping issues using Spring Data Elasticsearch, it see's the script field value as a double type.

Example script:

"script_fields": {
    "isPast": {
       "script": {
          "inline": "doc['someDate'].value > now",
          "lang": "expression",
          "params": {
             "now": 1484860619114
          }
       }
    }
 },

(system) #2

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