Hi there,
I have a query with 3 should filters, with different boost values, like this
"should": [
{
"constant_score": {
"filter": {
"term": {
"url.keyword": "myurl.com"
}
},
"_name": "url",
"boost": 20
}
},
{
"constant_score": {
"filter": {
"term": {
"child_urls.keyword": "myurl.com"
}
},
"_name": "child_url",
"boost": 18
}
},
{
"constant_score": {
"filter": {
"term": {
"profile": "main"
}
},
"_name": "is_main",
"boost": 80
}
},
minimum_should_match":1,
`
I'd like to force the result to match at least on "url" or "child_ur" and if it also matches profile, I want to boos this document.
The problem is that with minimum_should_match":1,
I end up always matching since the profile:main
will always match.
Is there any way to scope the minimum_should_match
to a subset of should
? I can't specify the minimum value to 2, because I want to match even if the profile is not main.