可以组合多重查询
must:查询必须匹配搜索条件,譬如 and
should:查询匹配满足1个以上条件,譬如 or
must_not:不匹配搜索条件,一个都不要满足
POST http://10.0.0.220:9200/shop/_doc/_search
{
"query": {
"bool":{
"must":[
{
"multi_match":{
"query":"为道在哪里",
"fields":[
"desc","nickname"
]
}
},{
"term":{
"sex":1
}
}
],
"should":[
{
"match":{
"username":{
"query":"二百五"
}
}
}
]
}
}
}