【ElasticSearch(六)进阶】match匹配,match_phrase 短语匹配
一、match进行 基本类型(非字符串)精确匹配
查询 account_number 是 20 的所有结果:
GET /bank/_search
{
"query": {
"match": {
"account_number": 20
}
}
}
返回内容:
此时max_score为1.0,该条记录的_score就是1.0,这是精确匹配。
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [