【发布时间】:2019-03-29 14:06:56
【问题描述】:
我正在尝试过滤Elasticsearch 中的期间的条目。我使用 Elasticsearch version 6.4.1。
我使用这样的网址:
http://localhost:9200/index_name/_search?q=stamper:[2018-10-01T00:00:00.000Z+TO+2018-10-07T23:59:59.999Z]&q=city=London
结果我看到所有关于伦敦市的条目,但日期范围过滤器不起作用。如何解决?
我检查了 Kibana 中stamper 字段的格式。它告诉我这个:
Type: date
Format: Date
Result 示例:
"hits": [
{
"_index": "youtube",
"_type": "doc",
"_id": "K6OKZ2YBmp2VWXSDhFPc",
"_score": 0.9570947,
"_source": {
"avg": 6258.5,
"price": "2259",
"region": "England",
"@version": "1",
"description_id": "7406",
"stamper": "2018-09-28T08:00:00.000Z",,
"area": "London",
"datefor": "2018-09-28",
"@timestamp": "2018-10-12T09:10:23.103Z",
"city": "London",
}
},
[***]
]
我注意到,如果我们从 URL 中删除 &q=city=London,它会返回所有城市期间的所有条目。看来我的网址不正确。如何制作正确的多参数网址?
【问题讨论】:
标签: json elasticsearch elastic-stack