bool
把各种其它查询通过must
(必须 )、must_not
(必须不)、should
(应该)的方式进行组合
在 Postman中,向ES服务器发GET请求 :http://127.0.0.1:9200/student/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"name": "zhangsan"
}
}
],
"must_not": [
{
"match": {
"age": "40"
}
}
],
"should": [
{
"match": {
"sex": "男"
}
}
]
}
}
}
服务器响应结果