【发布时间】:2019-08-12 17:52:21
【问题描述】:
似乎我遵循了我找到的每一个类似的答案,但我就是不知道出了什么问题......
这是一个“匹配所有”查询:
{
"query": {
"match_all": {}
}
}
..和结果:
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "unittest_index_unittestdocument",
"_type": "unittestdocument",
"_id": "a.b",
"_score": 1,
"_source": {
"id": "a.b",
"docdate": "2018-01-24T09:45:44.4168345+02:00",
"primarykeywords": [
"keyword"
],
"primarytitles": [
"the title of a document"
]
}
}
]
}
}
但是当我尝试用这样的日期过滤它时:
{
"query":{
"bool":{
"must":{
"multi_match":{
"type":"most_fields",
"query":"document",
"fields":[ "primarytitles","primarykeywords" ]
}
},
"filter": [
{"range":{ "docdate": { "gte":"1900-01-23T15:17:12.7313261+02:00" } } }
]
}
}
}
我的点击率为零...
我尝试关注此https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html 和此filtering by date in elasticsearch,但完全没有成功..
有什么我看不到的区别吗???
请注意,当我删除日期过滤器并在“主要关键字”上添加术语过滤器时,我会得到我想要的结果。唯一的问题是范围过滤器
【问题讨论】:
标签: elasticsearch filter range