面试题答案
一键面试{
"query": {
"multi_match": {
"query": "要匹配的模糊内容",
"fields": ["title", "description"],
"type": "best_fields"
}
}
}
上述示例中,multi_match
用于对多个字段进行匹配查询,query
中填写要模糊匹配的具体内容,fields
数组指定了需要匹配的字段为 title
和 description
,type
设置为 best_fields
表示会从多个字段中寻找最佳匹配。