Using Query Ranking Expressions
Using Query Ranking Expressions
One of the most direct ways you can influence relevance in your search solution is by designing and using query ranking expressions (QREs).
By default, the index computes a unique ranking score for each query result item based on various standard factors such as term frequency-inverse document frequency (TFIDF), term adjacency, and modification date (see Index Ranking Phases). A QRE lets you further increase (or reduce) the ranking score of a specific subset of query result items by a fixed amount (see About Search Result Ranking).
You can easily design, maintain, and test QREs by creating ranking expression and featured result rules in a query pipeline (see Manage Ranking Expression Rules and Manage Featured Result Rules). You can also enforce QREs directly in the code of your search interface, although you should only use this approach when truly necessary (see Add Query Ranking Expressions at Query Time).
Among other things, you could use QREs to:
-
Top a result for a specific query.
E.g., significantly increase the ranking score of a single item you want to promote when the end user submits a specific popular basic query expression (
q
) (this would likely be a featured result rule in a query pipeline). -
Promote new content related to a query.
E.g., slightly increase the ranking score of items containing the latest release notes of a product when the end user submits the
what’s new
basic query expression while the tab corresponding to this product is selected in the search interface. -
Demote content intended for another audience.
E.g., slightly reduce the ranking score of administrator-oriented documentation when the end user has identified themselves as a developer.
-
Demote legacy content.
E.g., significantly reduce the ranking score of all items related to a legacy product, unless that product is explicitly included as a basic query expression term.
|
Leading practice
|
What’s Next?
The next article in this section explains how you can take advantage of the Coveo ML Query Suggestions (QS) and Automatic Relevance Tuning (ART) features (see Leveraging Coveo Machine Learning).