首页 > 解决方案 > 如何在 ElasticSearch 上按当前时间过滤 integer_range 字段?

问题描述

我的索引映射是这样的:

"availableHours" : {
   "type" : "integer_range"
}

一个样本是:

"availableHours" : [
   {
        "gte" : "61000",
        "lte" : "62200"
   },
   {
        "gte" : "71100",
        "lte" : "72300"
   },
]

Format: which day of the week/hour/minute

我想按当前时间过滤 integer_range 字段。但我不能给出当前时间。我应该从 ElasticSearch 获取当前时间。

是否可以通过查询来做到这一点?

标签: elasticsearch

解决方案


https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html

我不确定你想要得到什么,但我认为如果你能给出更多解释的例子,这个页面会对你有所帮助我想我可以给你你正在寻找的确切查询


推荐阅读