如何与当前日期时间进行弹性搜索日期比较

时间:2018-10-01 21:45:06

标签: date elasticsearch

我正在尝试使用Elasticsearch进行搜索查询: enter image description here

它引发异常:

 "script": "if((doc['description.keyword'].value=='wood') && (doc['EndDate'] < '2018-01-01' )) {'available'} else {'unavailable'}",
      "lang": "painless",
      "caused_by": {
        "type": "class_cast_exception",
        "reason": "Cannot apply [<] operation to types [org.elasticsearch.index.fielddata.ScriptDocValues.Dates] and [java.lang.String]."
      }
    }
  }

如何根据日期字段检查日期小于或小于无痛脚本的时间?

请提出建议。

0 个答案:

没有答案
相关问题