Query Ranking
Query Ranking
Legacy feature
This article pertains to the Coveo Hive framework which is now in maintenance mode. Choose one of Coveo’s more modern, lightweight, and responsive libraries for any future search interface development. See the search interface Implementation guide for more details. |
Implements the CoveoForSitecoreRankingExpression component which represents a query ranking expression (QRE) created from rules defined in the Sitecore Rules Editor.
This query ranking expression is added to the advanced query expression (aq
) on calls to the Search API to modify the item ranking score
value.
Usage notes
-
The Sitecore Rules Editor is only available with the Enterprise Edition. The Sitecore Rules Editor is required to set
Boost expression rules
in the data source. -
The Query Ranking rendering is added automatically with the Coveo Search Interface rendering and Coveo Tab renderings.
-
You need to insert the Coveo Relevancy Sort rendering and select this sorting criterion for your result list to obtain document
score
values, otherwisescore
values will be zero on all result items. -
Boosting is cumulative. When you specify boosting rules on the Coveo Search Interface and on the active Coveo Tab, items matching both rules are boosted by the sum of both
modifier
numbers.
Insertion location
Coveo Hive
The Query Ranking rendering is an Allowed Control in the following placeholder(s): Coveo UI
, Recommendations Components
, Searchbox Components
Coveo Hive SXA
The Coveo for Sitecore SXA Query Ranking rendering is meant to be inserted in specific placeholders (that is, Coveo UI
, Recommendations Components
, Searchbox Components
).
Data source options
The following table lists the available data source options for this rendering.
Option name | Description |
---|---|
Enterprise edition Boost expression rules |
List of condition-action rules created in the Sitecore Rules Editor.
The Coveo Boosting |
Sample Generated HTML and Corresponding Result
To boost the score
of commerce items currently on sale by 1000 points, you define the following query ranking rule with a number
value of 100 (as per the modifier
-score
1 to 10 ratio) in the Coveo Search Interface data source:
Generated HTML:
<div class="CoveoForSitecoreRankingExpression"
data-sc-ranking-scope-node="{"rankingExpressions" : [{"expression" : {"type" : "field" ,
"fieldName" : "OnPromotion" , "operator" : {"name" : "==" , "value" : 1},
"fieldValueType" : {"name" : "string" , "value" : 3},
"fieldValues" : ["1"]},"modifier" : 100}],"rankingFunctions" : [],"textualRankingExpressions" : []}">
</div>
Search API call aq
:
Matching document score
: