jagamot
jagamot

Reputation: 5464

SOLR - How to influence score with popularity field?

Is there a way to achieve the following -

We have a RANK field in each document, and essentially, I would like my score to be influenced by this RANK as follows -

score = (score * 0.1) + RANK

How can I achieve this with function queries or through some other mechanism

Solr Version # 7.4.0

Thanks!

Upvotes: 1

Views: 377

Answers (1)

MatsLindh
MatsLindh

Reputation: 52902

The bf (boost function) and bq functions are both additive, meaning that their result is added to the existing score.

So instead of multiplying the score by 0.1, multiply the popularity by 10 (in effect giving you the same rank):

bf=product(RANK,10)

(mul is an alias for product)

Upvotes: 1

Related Questions