0
我需要ElasticSearch完全匹配某些字段,目前使用multi_match。例如,用戶鍵入long beach chiropractor
。Elasticsearch完全匹配某些字段,但不是其他字段
我想要long beach
完全匹配城市字段,並且不返回seal beach
或glass beach
的結果。
同時chiropractor
也應該匹配chiropractic
。
這裏是我使用的當前查詢:
"query": {
"bool": {
"should": [
{
"multi_match": {
"fields": [
"title",
"location_address_address_1.value",
"location_address_city.value^2",
"location_address_state.value",
"specialty" // e.g. chiropractor
],
"query": "chiropractor long beach",
"boost": 6,
"type": "cross_fields"
}
}
]
}
},