1.must相当于and

2.must not 相当于 not in 

3.should相当于or

POST kibana_sample_data_flights-1227/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "DestCountry.keyword": {
              "value": "AU"
            }
          }
        }
      ],
      "must_not": [
        {
          "term": {
            "OriginCityName.keyword": {
              "value": "Cape Town"
            }
          }
        }
      ],
      "should": [
        {
          "term": {
            "FlightDelay": {
              "value": false
            }
          }
        },
        {
          "term": {
            "DestWeather.keyword": {
              "value": "Sunny"
            }
          }
        }
      ]
    }
  }
}

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐