{"query": { "bool": { "should": [ {"bool": { "must": [ {} ] } }, {"bool": { "must": [ {} ] }} ] } } }
bool filter
bool filtering can be used to combine the boolean logic of query results of multiple filter conditions. It includes the following operators:
- must :: Exact match of multiple query conditions, equivalent to and.
- must_not :: Inverse matching of multiple query conditions, equivalent to not.
- should :: At least one query condition matches, equivalent to or.
These parameters can inherit a filter condition or an array of filter conditions respectively:
{
"bool": {
"must": { "term": { "folder": "inbox" }},
"must_not": { "term": { "tag": "spam" }},
"should": [
{ "term": { "starred": true }},
{ "term": { "unread": true }}
]
}
}