This topic seems appear before, but I couldn't find useful answer for that.
With function_score query,
Is there any way to normalize query score before calculate with function score by boost_mode?
The intention here is keeping same weight for query score and function score.
As I know, query score range can be different.
For example, with cross_fields type, it seems that more query terms return bigger score.
search request A
| query | doc | query score | function score | final score | order |
|---|---|---|---|---|---|
| developer | doc1 | 50 | 35 | 85 | 2 |
| developer | doc2 | 40 | 50 | 90 | 1 |
search request B
| query | doc | query score | function score | final score | order |
|---|---|---|---|---|---|
| developer programmer software engineer web ruby | doc1 | 100 | 35 | 135 | 1 |
| developer programmer software engineer web ruby | doc2 | 80 | 50 | 130 | 2 |
The result order is different due to the weight of function score.
Can I normalize query score like below?
search request B
| query | doc | query score | function score | final score | order |
|---|---|---|---|---|---|
| developer programmer software engineer web ruby | doc1 | 50 | 35 | 85 | 2 |
| developer programmer software engineer web ruby | doc2 | 40 | 50 | 90 | 1 |