es组合多个条件进行查询

时间:2021-08-25 19:22:53

GET /test_index/_search
{
  "query": {
    "bool": {
      "must": { "match": { "name": "tom" }},
      "should": [
        { "match": { "hired": true }},
        { "bool": {
          "must": { "match": { "personality": "good" }},
          "must_not": { "match": { "rude": true }}
        }}
      ],
      "minimum_should_match": 1
    }
  }
}