Managing Query Pipelines
- What Is a Query Pipeline
- Routing Mechanisms and Rules
- Deployment Overview
- Adding Coveo ML Automatic Relevance Tuning Models
- Adding Coveo ML Query Suggestions Models
- Adding Coveo ML Recommendations Models
- Editing a Coveo ML Model Without Service Interruption
- Managing Thesaurus
- Managing Featured Results
- Managing Stop Words
- Managing Ranking Expressions
- Managing Ranking Weights
- Managing Triggers
- Managing Filters
- Managing Query Parameters
- Managing Rules and Rule Conditions
- Coding Query Pipeline Rules
- Leveraging Custom Context Information in Salesforce
- Testing Changes
- Exporting/Importing Between Organizations
Managing Query Pipeline Ranking Expressions
On top of the default ranking factors (see Managing Query Pipeline Ranking Expressions), you can influence items ranking score by adding query ranking expressions (see Who Can Perform the Page Actions).
A query ranking expression (QRE) boosts or lowers the score of search results matching an expression. When a member of your Coveo™ Organization performs a query, the Coveo Cloud Platform returns results based on the ranking factors set in your Coveo Cloud organization. From these results, those that match a query ranking expression will have their ranking score either increased or decreased, depending on the settings you specified. When the search interface sorting is set to Relevance, the search results are presented in descending relevance score order to present the most pertinent items at the top.
The pre-tuned ranking weights used by the Coveo Cloud Platform for each of the ranking factor have been optimized over years of experience with a wide variety of indexed content to produce highly satisfying out-of-the-box relevance scores in most cases. Thus, query ranking expressions should be used only to influence search results relevance in particular contexts.
Query ranking expressions apply in the order you defined them. If two query ranking expressions concern the same expression, the ranking value of these QRE are added together.
You have a query ranking expression boosting the
Salesforce for outlookexpression by 100 and another that lowers the same expression by 50. The final result in the index is +50.
When a query pipeline contains Coveo Machine Learning (Coveo ML) models, avoid or minimize the use of ranking expression rules. Ranking expression rules are static and can thus negatively impact Coveo ML models which follow trends. Therefore, create ranking expression rules with caution.
Set the boosting or lowering value of a query ranking expression between -100 and 100 to not completely override the ranking score of a search result.
An exaggerated number of QREs or too many complex ones can significantly impact the performance as well as the search relevance troubleshooting time.
Consider fine-tuning the item ranking score when you want to improve a specific relevance issue.
Only keep changes for which you can validate the desired effect is reached and side effects are negligible.
Add at least a condition to be respected before a query expression applies itself.
Avoid making changes without a specific purpose.
Access the “Ranking Expressions” Tab of a Pipeline
If not already done, log in to your Coveo Cloud Organization with an Admin or Relevance Analyst user role account.
In the navigation menu on the left, under Search Optimization, select Query Pipelines.
In the Query Pipelines page, access the query pipeline in which you find the ranking expressions rules you want to manage by clicking a pipeline under the Name column.
In the selected pipeline page, select the Ranking Expressions tab.
Manage Query Pipeline Ranking Expressions
In the Ranking Expressions tab, you can add a new ranking expression rule (see Access the Ranking Expressions Tab of a Pipeline):
Access the Add a Ranking Expression Rule dialog, click Add Rule.
In the Add a Ranking Expression Rule dialog that appears:
In the first box, enter one or more expressions to be boosted or lowered in ranking score.
A matching expression is any query expression that meets the Coveo query syntax (see Coveo Cloud Query Syntax Reference). You can review the available fields and values for all your Coveo Cloud organization items in the Content Browser (see Inspecting Items With the Content Browser).
An item score is boosted or lowered if the item field value matches the field query you entered.
You want to boost the score of items that are products on your website, so you enter the following expression:
An item score is boosted or lowered if the item contains ANY of the expressions you entered on a separate line. If you want an item score to be impacted when the item contains ALL the expressions you specified, separate expressions with the AND operator.
You want to boost the score of answers written in English on your support site that were accepted by the customer who asked the question, so you enter the following expression:
@acceptedanswer=="1" AND @syslanguage=="English"
You can also take advantage of query pipeline custom context values in your matching expression when they are passed along with queries (see Adding Pipeline Context to a Search Page Using the Interface Editor). You can inject a custom context value in your matching expression using the following syntax:
You have an
audiencefield for which possible values are:
Developer. You also have a
UserTypecustom context that can take the same values.
When authenticated search page users perform a search, you want to boost all results matching they audience using the following expression:
If the search user is identified as a
UserTypecontext, the expression translates to:
Select Boost or Lower to determine if the expression respectively increases or decreases the item ranking score.
Click and drag the slider to the desired value or use the up and down arrows to increase or decrease the score by increments.
Coveo for Salesforceis present in a query, you want the ranking score of items containing the expression to be boosted by 10 points.
You can increase of decrease the score by a value between respectively 1 and 1000 and -1 and -1000. It is however recommended to increase or decrease the ranking score of search results by a maximum of 100 as more can completely override their ranking score.
You can disable a rule by dragging the slider to 0.
The expression ranking score value is correlated to the final search results ranking score by a 1 to 10 ratio.
Your ranking expression score value is 100. Consequently this expression adds 1000 to the final search result ranking score of matching items.
The ranking expression rule is effective the moment it is saved.
For developers, you can also directly enter a rule that respects the Query Pipeline Language (QPL) syntax for ranking expressions (see Ranking Expressions):
In the Ranking Expressions tab, click Add Rule with Code.
In the Add a Rule in QPL dialog, in the form editor box, enter a ranking expressions rule.
You can perform other actions on rules (see Managing Query Pipeline Rules and Conditions From Tabs).
You can link a condition to a rule (see Managing Query Pipeline Conditions).
In the search interface(s) for your Coveo Cloud organization such as the Content Browser, test your ranking expression rule to ensure that it improves search result relevance. Make adjustments when needed.
You can know the ranking score of a result, by pressing
Altand double clicking a search result box, and then looking next to Score in the Debug window.
Navigate Through Ranking Expression Rule Pages
In the Ranking Expressions tab, at the bottom-right of the table, click the left and right arrow icons, or a page number to navigate through pages (see Access the Ranking Expressions Tab of a Pipeline).
Set the Number of Ranking Expression Rules per Page
In the Ranking Expressions tab, at the bottom-left of the page, select 10 or 100 (see Access the Ranking Expressions Tab of a Pipeline).
By default, the table shows 10 rules per page.
Who Can Perform the Page Actions
The required roles are: