multi_match查询默认为best_fields类型,更适合变形的查询句子。
multi_match的most_fields类型查询
{
"query": {
"multi_match": {
"type": "most_fields",
"query": "待查询句子",
"fields": [
"字段1",
"字段2",
"字段3"
]
}
}
}
多个match查询
{
"query": {
"bool": {
"should": [
{"match": {
"字段1": "待查询句子"
}},
{"match": {
"字段3": "待查询句子"
}},
{"match": {
"字段3": "待查询句子"
}}
]
}
}
}
multi_match查询默认为best_fields类型
{
"query": {
"multi_match": {
"type": "best_fields",
"query": "待查询句子",
"fields": [
"字段1",
"字段2",
"字段3"
]
}
}
}