No problem. Use a boost function. In a DisMaxRequestHandler spec
in solrconfig.xml, specify this:

  <str name="bf">
     popularity^0.5
  </str>

This value will be added to the score before ranking.

You will probably need to fuss with the multiplier to get the popularity
to the right proportion of the total score. I find it handy to return the
score and the popularity value and look over a few test queries to adjust
that.

wunder

On 5/9/07 4:58 PM, "Nick Jenkin" <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> I have a popularity field in my solr index, this field is a popularity
> rating of a particular product (based on the number of product views
> etc).
> 
> I want to be able to integrate this number into the search result
> sorting such that a product with a higher popularity rating is ranking
> higher in the search results.
> 
> I can always do:
> title:(harry potter); popularity desc, score desc;
> 
> In this example I will say be searching for harry potter books,
> obviously the latest book has a very high popularity rating, but lets
> say a completely unrelated product with a high popularity also matches
> for harry potter and gets into the search results (but has a very low
> score value), this will bring it to the top of the results.
> 
> I want to be able to weight popularity in such a way that it boosts
> the score, but will not greatly affect the search results.
> 
> Is this possible?
> 
> Thanks

Reply via email to