I want to be able to select parents that don't have any children matching a particular set of criteria. I thought that if I did:
{
"has_child": {
"max_children": 0,
"type": "event",
"filter": {
"bool": {
"must": [
{
"bool": {
"must": [
{
"term": {
"cs_e": "eventF"
}
}
],
"should": [],
"mustNot": []
}
}
],
"should": [],
"mustNot": []
}
}
}
}
then this would return me parents who had a maximum of 0 children - ie the parents that don't match. Curiously, however, I do get one parent back from the query, and that parent has one child that matches.
Is this expected? (Possibly I have messed up somewhere or misunderstood)?
Many thanks!