In this chapter, we saw the default relevance algorithm used by Solr and/or Lucene. We saw how the algorithm can be tweaked or overwritten to change the parameters that control the score of a document for a given query. We saw how to use multiple similarity classes for different fields within the same Solr schema. We explored the information gain model and saw the complexities involved in implementing the same. Furthermore, we saw additional alternatives to the default TF-IDF similarity available with Solr and Lucene. We went through the BM25 and DFR similarity models. We also understood that, in addition to selecting a similarity algorithm, we should perform A/B testing to determine which scoring algorithm the end users prefer and can be beneficial to the business.
In the next chapter, we will explore Solr internals and build some custom queries. In addition, we will understand how different parsers work in the creation of a Solr query and how the query actually gets executed. We will also write our own Solr plugin.