In the documentation for the compound operator, it reads that the scores for each matching clause in a should statement are summed together:
The returned score is the sum of the scores of all the subqueries in the clause.
Is there a way I can customize the scoring so that the maximum subquery score is used? I’m using the should operator to search through multiple fields (exactly 4) in a single query. I’m trying to customize the scoring so that documents matching on multiple fields don’t dominate over documents matching on fewer fields when the results are ranked. My should clause uses a mix of autocomplete and text operators.
This is an imaginary example similar to what I have:
[
{
"$search": {
"compound": {
"should": [
{
"text": {
"query": "Honeycrisp",
"path": "name"
}
}, {
"autocomplete": {
"query": "Honeycrisp",
"path": "description"
}
}
]
}
}
}
]
So I want records matching at least one of these fields but I want to limit the relevance score to the maximum score of the subqueries.