【发布时间】:2021-01-04 17:58:55
【问题描述】:
我必须使用 3 个字段(答案、问题;关键字、来源)
-
我的要求是我需要排除字段 answer = "UNHANDLED"
-
我需要字段 question.keyword
-
我需要包含字段 source = "sonax"
我使用以下查询来获取输出。但是在应用字段 answer = "UNHANDLED" 后,我仍然在数据中获得未处理的记录。
{
"query": {
"bool": {
"must_not": {
"term": {
"answer": "UNHANDLED"
}
},
"must": {
"term": {
"source": "sonax"
}
}
}
},
"aggs": {
"top_tags": {
"terms": {
"field": "question.keyword"
},
"aggs": {
"top_faq_hits": {
"top_hits": {
"_source": {
"includes": [
"answer"
]
},
"size": 1
}
}
}
}
}
}
问候, 帕布
【问题讨论】:
-
能否分享一些示例索引数据和预期的搜索结果?
标签: elasticsearch elastic-stack elasticsearch-5