When combining should with filter, the conditions in should are ignored. When using must, the filter works as expected.
Query without filter:
{
"query": {
"bool": {
"should": [
{
"match": {
"address": "mill"
}
},
{
"match": {
"address": "lane"
}
}
]
}
}
}
Hits: 19
Example including filter:
{
"query": {
"bool": {
"should": [
{
"match": {
"address": "mill"
}
},
{
"match": {
"address": "lane"
}
}
],
"filter": {
"range": {
"balance": {
"gte": 20000,
"lte": 30000
}
}
}
}
}
}
Hits: 217 (basically ignoring the should condition)
Thanks for your help,
Christian