【发布时间】:2020-12-03 00:24:47
【问题描述】:
刚接触 Elasticsearch,正在研究一个我不愿更改的旧模型。我有日期字段,如果它的值为null,我们将不会输入(我认为是因为 ES 处理0000-00-00 的方式)。我希望能够查询具有特定日期或字段不存在的数据。这是我所拥有的:
{
"size": 10000,
"query": {
"bool": {
"must": [
{
"term": {
"AccountID": "xxxx"
}
},
{
"term": {
"LocationID": "xxxx"
}
},
{
"should": [
{
"range": {
"CloseDate": {
"gte": "2020-11-01",
"lte": "2020-12-02"
}
}
},
{
"bool": {
"must_not": {
"exists": {
"field": "CloseDate"
}
}
}
}
]
}
]
}
}
}
我在尝试这个时得到了[should] query malformed, no start_object after query name 的错误。是否有替代语法或确实格式错误?
【问题讨论】:
-
另外,请注意这是elasticsearch 6.3
标签: elasticsearch aws-elasticsearch