ES查询某个字段没有值的数据

单独查询某个字段没有值,没有附加条件

{
  "query": {
    "bool": {
      "must_not": {
        "exists": {
          "field": "materielName"
        }
      }
    }
  }
} 

单独查询某个字段没有值,有附加条件

{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "purchaserId": 1
          }
        }
      ],
      "must_not": [
        {
          "exists": {
            "field": "agentCompanyName"
          }
        }
      ]
    }
  }
}

 

posted @ 2019-09-02 12:12  林深时见鹿!  阅读(4094)  评论(0编辑  收藏  举报
博客已稳定运行: