Using "not filter" and "match_all" filter on nested objects


I found that when looking for empty arrays of nested objects, I need to put
the not filter around the nested filter.
This is ok, but in our situation, it would be nice if we could have it the
other way around, so that we can have the nested filter as the outer level.
It works for term queries that way, but not for match_all queries.

Note: the match_all for finding non-empty values is a technique borrowed

Is there a way to have the nested filter as the outer one, and somehow
achieve the same results?

The following gist has curl with mappings & queries:

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit