Hi, I am new to ES. Have looked around for an answer, but was unable to find one...
Say, I have a data index like this
listing (parent)
- availabilities (nested objects)
- boolean
- date
For a given date range, I'd like to return a listing if and only if all the boolean field is set to true.
My query looks like this
GET /listings/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"city": "Montreal"
}
},
{
"nested": {
"path": "availabilities",
"query": {
"bool": {
"must": [
{
"match": {
"availabilities.available": {
"query": true
}
}
},
{
"range": {
"availabilities.date": {
"gte": "2019-05-30",
"lt": "2019-06-01",
"relation": "within"
}
}
}
]
}
}
}
}
]
}
}
}
However, when I run the above query, it will return a listing when one of the boolean field is true. How can I modify my query? Thx for the help!