We recently moved to ElasticSearch version 7.6.2 from version 6.2.3
The search query that we use has field boosts applied in different match queries. I was looking into the changes related to scoring of docs in the new version and found that the boost applied in the newer version varies from the actual number that I used in the search query.
(I checked using the explain API).
eg.,
Search Query:
{
"explain": true,
"query": {
"match": {
"connectorSpecific.alpha": {
"query":"goexpense",
"boost": 5
}
}
}
}
Score Generated:
"_explanation" : {
"value" : 46.694355,
"description" : "weight(connectorSpecific.alpha:goexpense in 226) [PerFieldSimilarity], result of:",
"details" : [
{
"value" : 46.694355,
"description" : "score(freq=1.0), computed as boost * idf * tf from:",
"details" : [
{
"value" : 11.0,
"description" : "boost",
"details" : [ ]
},
{
"value" : 6.449522,
"description" : "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
"details" : [
{
"value" : 2,
"description" : "n, number of documents containing term",
"details" : [ ]
},
{
"value" : 1580,
"description" : "N, total number of documents with field",
"details" : [ ]
}
]
},
{
"value" : 0.6581793,
"description" : "tf, computed as freq / (freq + k1 * (1 - b + b * dl / avgdl)) from:",
"details" : [
{
"value" : 1.0,
"description" : "freq, occurrences of term within document",
"details" : [ ]
},
{
"value" : 1.2,
"description" : "k1, term saturation parameter",
"details" : [ ]
},
{
"value" : 0.75,
"description" : "b, length normalization parameter",
"details" : [ ]
},
{
"value" : 1.0,
"description" : "dl, length of field",
"details" : [ ]
},
{
"value" : 4.1031647,
"description" : "avgdl, average length of field",
"details" : [ ]
}
]
}
]
}
]
}
Is there a reason for such a difference in boost?