1
有彈性搜索以下查詢:Multi_match和匹配查詢我一起
{
"query": {
"multi_match": {
"query": "bluefin bat",
"type": "phrase",
"fields": [
"title^5",
"body.value"
]
}
},
"highlight": {
"fields": {
"body.value": {
"number_of_fragments": 3
}
}
},
"fields": [
"title",
"id"
]
}
我一直在使用「dis_max」試過,但然後我的兩個字段必須搜索相同的查詢。 剩餘的匹配查詢具有不同的查詢文本。
剩下的匹配查詢是這樣的:
{
"query": {
"match": {
"ingredients": "key1, key2",
"analyzer": "keyword_analyzer"
}
}
}
我怎麼能這兩個查詢集成,而不使用dis_max加盟。