This is what worked for me:
GET index/_search
{
"query": {
"bool": {
"must_not": [
{
"bool": {
"must": [
{
"term": {
"bool-facet.criteria1": false
}
},
{
"term": {
"bool-facet.criteria2": false
}
}
]
}
}
]
}
}
}
You should use must and must_not in the same bool query.
{
"bool": {
"must_not": [{
"nested": {
"path": "fields",
"query": {
"terms": {
"fields.value.raw": [
"200"
]
}
}
}
}],
"must": [{
"match": {
"fields.uid": "number"
}
}]
}
}