concept relevancy score in category solr

appears as: relevcy score, relevancy score, relevcy scores, relevcy score, relevcy scores, The relevcy score
Solr in Action

This is an excerpt from Manning's book Solr in Action.

Solr does a good job out of the box of ensuring that the ordering of search results brings back the best matches at the top of the results list. It does this by calculating a relevancy score for each document and then sorting the search results from the highest score to the lowest. This section will provide an overview of how these relevancy scores are calculated and what factors influence them. We’ll dig into both the theory behind Solr’s default relevancy calculation and the specific calculations used to compute the relevancy scores, providing intuitive examples along the way to ensure you leave this section with a solid understanding of what, to many, can be the most elusive aspect of working with Solr. We’ll start by discussing the Similarity class, which is responsible for most aspects of a query’s relevancy score calculation.

If you can tell Solr which fields in your document (such as a title field) are more important, for example, Solr can weight them higher when calculating relevancy scores. Additionally, if you have user behavior—such as clicks or purchases—on each document, you could pass this information along to Solr so that it can better understand which documents are related to each other based upon which ones similar users acted upon together. This is the basis of how many recommendation engines work, and you can build your own personalized search experience (or a Solr-based recommendation engine) using these same techniques.

In the example from listing 16.2, one disturbing problem your application’s users may notice is that in a search for red lobster, the restaurant named Joe’s Crab Shack is showing higher in the search results than the restaurant actually named Red Lobster. Referring to the relevancy explanation in listing 16.2, we can see that the total relevancy score for Joe’s Crab Shack was 1.7071067, which was the sum of the score for the terms red (score=0.70710677) and lobster (score=0.99999994). Meanwhile, the relevancy score for the restaurant named Red Lobster was 0.8838835, which was the sum of the score for the terms red (score=0.44194174) and lobster (score=0.44194174). The idf for every term is 1.0 in this example, so it’s not impacting the results in this simple example.