Problem
What's the best way to filter for:
- All records where
"type": "red"and"expired": trueis present?
Sample structure
[
{
"cheeses": [
{"type": "red", "expired": false},
{"type": "red", "expired": true},
]
},
{
"cheeses": [
{"type": "yellow", "expired": false},
{"type": "red", "expired": true},
]
}
]
What I've tried
(just an example of the pattern)
{
"query": {
"bool": {
"filter": [
{
"range": {
"cheeses.type": {
"gt": "<x>"
}
}
},
{
"match": {
"cheeses.expired": {
"query": true
}
}
}
]
}
}
}