我正在使用弹性版本6+。没有过滤器,我将获得带有multi_match查询的搜索结果。但是当我使用状态之类的过滤器时,我无法获得所需的结果。
这是查询,请提供帮助,在此先感谢:)
GET /lessonss/lessons/_search
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "math",
"fields": [
"talent",
"category",
"name"
]
}
},
"filter": {
"bool": {
"should": [
{
"term": {
"status": "ACTIVE"
}
},
{
"term": {
"status": "ACKNOWLEDGED"
}
}
]
}
}
}
}
}
结果是:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}