Chapter 6. Relevance and Ranking
Youâre now armed with a good chunk of knowledge about getting up and running with Sphinx, creating and managing indexes, and writing proper queries. However, thereâs one more skill thatâs of use with nearly every site: improving search quality. So, letâs spend some time discussing quality in general and what Sphinx can offer, shall we?
Relevance Assessment: A Black Art
We canât really chase down âsearch qualityâ until we formally define it and decide how we measure it. An empirical approach, as in âHere, I just made up another custom ranking rule out of thin air and I think it will generally improve our results any time of day,â wears out very soon. After about the third such rule, you can no longer manage such an approach, because the total number of rule combinations explodes combinatorially, and arguing about (not to mention proving) the value of every single combination quickly becomes impossible. A scientific approach, as in âLet us introduce some comprehensible numerical metrics that can be computed programmatically and then grasped intuitively,â yields to automation and scales somewhat better.
So, what is search quality? Chapter 1 mentioned that documents in the result set are, by default, ordered using a relevance ranking function that assigns a different weight to every document, based on the current query, document contents, other document attributes, and other factors. But itâs very important to realize that the ...
Get Introduction to Search with Sphinx now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.