嘿~ 今天天气不错嘛

es 版本2.4.6 使用now关键词但是多次查询后查询结果不再改变

Elasticsearch | 作者 yunzaiqintian | 发布于2018年09月28日 | 阅读数:2516

DSL 如下 查询对象是嵌套结构{
    "from": 0,
    "query": {
        "bool": {
            "filter": {
                "bool": {
                    "must": {
                        "bool": {
                            "must": [
                                {
                                    "nested": {
                                        "path": "features",
                                        "query": {
                                            "range": {
                                                "features.time": {
                                                    "from": "now+8h-3s",
                                                    "include_lower": true,
                                                    "include_upper": true,
                                                    "to": "now+8h"
                                                }
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        }
    },
    "size": 10000,
    "sort": [
        {
            "features.time": {
                "nested_path": "features",
                "order": "asc"
            }
        }
    ]
}
在一定时间内重复查询几次结果不再变化,应该是有缓存了,直到对对应的索引库执行_cache/clear操作之后,查询的结果才发生变化,按道理来说,使用now 的话,不应该产生缓存啊,请各位大佬解决疑惑!!!
已邀请:

要回复问题请先登录注册