Chapter 6. Debug and Stats Component
Debug and stats are two components in Solarium used to get more information about the index statistics and how queries are executed and results returned. In this chapter we will explore both the components and go in depth on how to retrieve the index statistics using the stats component. We will also look at how Solr calculates relevance scores and how we can use PHP to get and display the query explanation returned by Solr. We will explore:
How Solr does relevance ranking
Executing a debug through PHP code
Running a debug on Solr interface
Displaying the output of debug query
Display query result statistics using the stats component
You could say why should I go into the theory about these components? What will this help me achieve? The benefit of using the debug component is to understand and analyze how the search result was ranked. Why did a certain document come on the top and why did another document come at the end? Further if you want to alter the ranking...