Must_not query in nested doc not working

I have written two queries the docs with field profiles.educations = null:

GET livecore/_search
{
  "query": {
    "nested": {
      "path": "profiles.educations",
      "query": {
        "bool": {
          "must_not": [
            {
              "exists": {
                "field": "profiles.educations"
              }
            }
          ]
        }
      }
    }
  }
}
GET livecore/_search
{
  "query": {
    "bool": {
      "must_not": [
        {
          "nested": {
            "path": "profiles.educations",
            "query": {
              "exists": {
                "field": "profiles.educations"
              }
            }
          }
        }
      ]
    }
  }
}

The second query solves the purpose, but the first one not. Please help.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.