【ElasticSearch(七)进阶】multi_match多字段匹配,bool复合查询
一、multi_match多字段匹配
例:查询 address 和 city 中任意一项包含 mill urie的结果
GET /bank/_search
{
"query":{
"multi_match": {
"query": "mill urie",
"fields": ["address","city"]
}
}
}
返回结果:
我们发现multi_match也会进行语句的分词,再评分。
{
"took" : 27,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 4,
"relation" : "eq"
},