Quite new to Solr 1.4 - seems to be very powerful indeed. However, I am stuck when trying to return search results in order of relevancy (score) and rating_value (a 0 to 5 star rating on each result).
I've tried ordering search results by "rating desc, score desc", and while this works, it feels a bit basic.
I would ultimately like to boost the relevancy of a search result based on how many stars it has been rated as (0 to 5). A 5-star result should therefore give the highest boost.
I did try adding 'rating_value:1^0.1 rating_value:2^0.2' etc, etc, but this seems to massively boost answers that have no keyword match, but do have a high star rating.
Any help is VERY much appreciated! Thanks, Seb
You are on the right track with adding the "rating_value" terms with boost values. However, make sure when you are constructing your query, that the keyword terms are "MUST" terms, which will require the doc to contain that term in order for it to be returned.
From there you can play with the relative boost values for each term. If the rating boost is too high, you can give the keywords more boost, and vice-versa. It's important to know that the absolute values of the boost is not comparable across fields, i.e. giving keywords a boost of 20 and rating_value a boost of 19 will does not mean that keywords will be boosted more, mainly because of length normalization. See Lucene's Similarity for more info.