MUST_NOT and EXIST in NESTED query

I use es 6.5.1 and have the same problem like:

Copy from the topic above.

PUT players
{
   "mappings": {
      "players": {
         "properties": {
            "features": {
               "type": "nested",
               "properties": {
                  "name": {
                     "type": "text",
                     "fields": {
                        "keyword": {
                           "type": "keyword",
                           "ignore_above": 256
                        }
                     }
                  },
                  "value": {
                     "type": "long"
                  }
               }
            },
            "name": {
               "type": "text",
               "fields": {
                  "keyword": {
                     "type": "keyword",
                     "ignore_above": 256
                  }
               }
            }
         }
      }
   }
}

I would like to find doc where 'features' does not has any child.

But solution presented in link not work for my.
Suggested solution:

POST players/players/_search
{
  "query": {
    "bool": {
      "must_not": [
        {
          "nested": {
            "path": "features",
            "query": {
              "exists": {
                "field": "features"
              }
            }
          }
        }
      ]
    }
  }
}

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