Solr normalize score before applying boost

134 Views Asked by At

Is it possible to normalize the score before the boosts gets applied?

Let's say I have 2 documents

Doc1:

text: xxxx

description: xxxx

number_published_in_this_year: 1

Doc2:

text: xxxx

description: xxxx

number_published_in_this_year: 10

Now when I search, assume if q=cookie&qf=title^10 description^10&bf=number_published_in_this_year^5

Assume tf-idf scores are as below:

Doc1: title - 4 description - 5

Doc2: title - 2.5 description - 1.5

With the normal approach, final score calculation would be

Final scores:

Doc1: 4*10 + 5*10 + 1*5 = 95

Doc2: 2.5*10 + 1.5*10 + 10*5 = 90

The idea is to normalize the score, so that text matching scores will not dominate other factors. ( in this case, number_published_in_this_year is much larger in case of the second document)

Doc1: 4/5 *10 + 5/5 *10 + 1*5 = 23

Doc2: 2.5/5 *10 + 1.5/5 *10 + 10*5 = 58

(or)

Doc1: 90/90 + 1*5 = 6

Doc2: 40/90 + 10*5 = 50.4

Now since doc2 has higher score, it will come on top.

Is this possible? Can someone help me on this?

0

There are 0 best solutions below