I'm confused about the behaviour of a query with shoulds.
I have the following query on a 6.2.3 cluster:
GET reporting_tags/_search
{
"query": {
"bool": {
"must": [
{"term": {"source": "analytics"}}
],
"should": [
{"range": {"created": {"lt": 1525206239677}}},
{
"bool": {
"must_not": [
{"exists": {"field": "created"}}
]
}
}
]
}
}
}
Unless I add an explicit "minimum_should_match": 1
, only the must part of the query limits the results. I get results that match none of the should clauses (tags with a created
property with a larger long than the one specified in the query). When I add minimum_should_match, then all is as it should be. Did the default change?