solrsolr-boost

Solr score boost - based on number of likes


I have added fs_votingapi_result in solr document this represents number of likes.

I found below function to improve the score based on fs_votingapi_result.

But I am unable to get the logic behind this - what are the extra parameters $vote_steepness, $total, $total, $vote_boost?

bf=recip(rord(fs_votingapi_result),$vote_steepness,$total,$total)^$vote_boost

I am new to solr and I am not able to find any document/article to get more idea about this.


Solution

  • This is in the Function Query documentation.

    recip

    A reciprocal function with recip(x,m,a,b) implementing a/(m*x+b). m,a,b are constants, x is any numeric field or arbitrarily complex function.


    rord

    The reversed ordinal of the indexed value. (In your case, the function: rord(fs_votingapi_result) would yield 1 for the record w the most votes, 2 for the second most votes, etc...)


    So

    recip(rord(fs_votingapi_result),$vote_steepness,$total,$total)

    = $total / ($vote_steepness * rev-ordinal-of-vote-result + $total)

    Then the result is boosted by $vote_boost to create the boost function (from bf param).

    = ($total / ($vote_steepness * rev-ordinal-of-vote-result + $total)) * $vote_boost

    Which is added to the document score from the rest of the query. (Then before scores are returned, they are normalized across all matching docs)

    The $<var> values are either defined in solrconfig.xml or more commonly passed as separate http query parameters.

    Hope that gives you a starting point.