Manage Ranking Weight Rules

A Coveo index uses a number of ranking factors to evaluate the relevance score of each search result for a given query. 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.

Users with the required privileges can configure query pipeline ranking weight rules to fine-tune one or more of the pre-tuned ranking factors for a specific query pipeline.

Create Ranking Weight Rules

  1. On the Query Pipelines (platform-eu | platform-au) page, click the query pipeline in which you want to add a rule, and then click Edit components in the Action bar.

  2. On the page that opens, select the Advanced tab.

  3. In the Advanced tab, on the left-hand side of the page, select Ranking weights.

  4. In the upper-right corner of the page, click Add Rule to access the Add a Ranking Weight Rule [1] subpage.

  5. Under Ranking Factors, drag the desired ranking factors sliders to the desired value.

  6. On the right-hand side, under Condition, you can optionally select a query pipeline condition in the drop-down menu or create a new one.

  7. Under Description, optionally enter information that will help you manage the rule in the future.

  8. Click Add Rule.

Edit Ranking Weight Rules

  1. On the Query Pipelines (platform-eu | platform-au) page, click the query pipeline in which you want to edit a rule, and then click Edit components in the Action bar.

  2. On the page that opens, select the Advanced tab.

  3. In the Advanced tab, on the left-hand side of the page, select Ranking weights.

  4. Click the rule you want to edit, and then click Edit in the Action bar [2] to access the Edit a Ranking Weight Rule subpage.

  5. Under Ranking Factors, drag the desired ranking factors sliders to the desired value.

  6. On the right-hand side, under Condition, you can optionally select a query pipeline condition in the drop-down menu or create a new one.

  7. Under Description, optionally enter information that will help you manage the rule in the future.

  8. Click Save.

Duplicate Ranking Weight Rules

  1. On the Query Pipelines (platform-eu | platform-au) page, click the query pipeline for which you want to duplicate query pipeline rules, and then click Edit components in the Action bar.

  2. On the page that opens, select the Advanced tab.

  3. In the Advanced tab, on the left-hand side of the page, select Ranking weights.

  4. In the Ranking weights subtab, click the rule you want to duplicate within the same pipeline (typically to create a slightly different rule).

  5. In the Action bar, click Duplicate.

The duplicated rule appears at the bottom of the list in the pipeline component tab.

Review Information About the Rule’s Creation or Last Modification

You can verify who created or last modified a given ranking weight rule by inspecting the Details column of the Result Weights subtab. The Details column also indicates the hour and date the rule was created or last modified.

  1. On the Query Pipelines (platform-eu | platform-au) page, click the query pipeline containing the rule for which you want to inspect the information of the Details column, and then click Edit components in the Action bar.

  2. On the page that opens, select the Advanced tab.

  3. In the Advanced tab, on the left side of the page, select Result Weights.

  4. In the Result Weights subtab, inspect the information of the Details column for the desired rule.

Delete Ranking Weight Rules

  1. On the Query Pipelines (platform-eu | platform-au) page, click the query pipeline for which you want to delete query pipeline rules, and then click Edit components in the Action bar.

  2. On the page that opens, select the Advanced tab.

  3. In the Advanced tab, on the left-hand side of the page, select Ranking weights.

  4. In the Ranking weights subtab, click the rule you want to delete.

  5. Click Delete to confirm.

Change the Rule Order

Query pipeline rules are executed in the order in which they appear on the page until a condition is satisfied.

  1. On the Query Pipelines (platform-eu | platform-au) page, click the query pipeline for which you want to manage the rules' execution order, and then click Edit components in the Action bar.

  2. On the page that opens, select the Advanced tab.

  3. In the Advanced tab, on the left-hand side of the page, select Ranking weights.

  4. In the Ranking weights subtab, click the rule whose position you want to change.

  5. In the Action bar, click Move up or Move down to change the position of the rule.

Leading Practices

Use Ranking Weight Rules Conditionally

Add a query pipeline condition to each ranking weight rule so that each rule only applies to the specific context in which you want to improve relevance.

Use Ranking Weight Rules Sparingly

The pre-tuned ranking weights for each of the ranking factors used by Coveo indexes have been optimized over years of experience with a wide variety of indexed content to deliver well-balanced out-of-the-box relevance scores. You can however adjust one or more of the available ranking factors when you see that the ranking of certain search results isn’t ideal in a specific search context or case.

Important

Be careful when making adjustments. By default, all queries going through the pipeline will be affected. Fixing the ranking for a specific context may have undesired effects on other contexts.

Test your Ranking Weight Rules

When creating ranking weight rules, you should validate the effects of your ranking weight rule in the Coveo JavaScript Search Framework Debug Panel (see rankingInfo Section).

Reference

Ranking Factors

You can tune the following ranking factors using the user interface options:

More options are available when defining ranking weight rules using the QPL syntax.

Note

The relative weight of each of the available ranking factors isn’t equal. Some weights affect the total ranking score more than others. Consequently, it may be difficult to predict and validate the effects of the changes you made to the ranking weight factors.

Item Last Modification

The relevance score is increased for items with a more recent modification date.

Keyword Frequency

The relevance score is increased for items containing a higher number of keyword occurrences. The boost increases proportionally to the number of times a keyword appears in an item relative to the number of times it appears in the index.

Keyword in Concept

Coveo uses a linguistic algorithm to create a list of the most important concepts found in an item.

The relevance score is increased for items containing keywords in their concepts.

Notes
  • For the Keyword in concept ranking factor to be modified by a ranking weight rule, the affected items must contain an item body.

  • The concepts of an item are stored in the @sysconcept field.

Keyword in Title

The relevance score is increased for items containing keywords in their title. The boost increases as the proportion of title terms matching the query increases.

Example

An item with a title containing the exact keywords will have a higher relevance score boost than an item with a title containing only one of the keywords.

Keyword in Summary

When indexing an item, Coveo uses a linguistic algorithm that scans and extracts all the readable sentences of an item. At query time, the algorithm relies on term frequency and proximity to select the sentences that best represent the query and creates an item summary made from those sentences. The more the summary contains queried keywords, the higher the score.

Note

For the Keyword in summary ranking factor to be modified by a ranking weight rule, the affected items must contain an item body.

Keyword Proximity

When a query includes more than one keyword, by default the relevance score is increased for items in which keywords appear close to each other. The boost increase is inversely proportional to the distance between the keywords in the item.

Example

An item containing keywords appearing side-by-side will have a higher relevance score boost than one containing the keywords dispersed in a paragraph.

Ranking Factor Value

When applying a weight to a ranking factor, you must choose a value from 0 to 9 where:

  • 5 is the default pre-tuned recommended ranking factor value.

  • 6 to 9 progressively boosts the weight of a ranking factor relative to its pre-tuned value.

  • 4 to 0 progressively reduces the weight of a ranking factor relative to its pre-tuned value.

QPL Syntax

Use the following query pipeline language (QPL) syntax to manage ranking weight rules:

rank <RANKING_FACTOR_CONFIGURATION>

<RANKING_FACTOR_CONFIGURATION>

A comma-separated list of key-value pairs where each key must be a valid ranking factor and each value must be an integer between 0 and 9 inclusively.

Example
rank adjacency: 9, concept: 6, title: 5, termCasing: 1, uri: 0

Available keys are:

adjacency

The proximity of query terms in the item.

This key is the equivalent of the Administration Console’s Keyword proximity ranking factor.

concept

Query terms in the automatically populated @concepts field for the item.

This key is the equivalent of the Administration Console’s Keyword in concept ranking factor.

customDocumentWeight

Custom weight assigned through an indexing pipeline extension for the item.

docDate

How recently the item was modified.

This key is the equivalent of the Administration Console’s Item last modification ranking factor.

formatted

The formatting of query terms in the item (e.g., heading level, bold, large, etc.).

language

Whether the item is in the language of the search interface from which the query originates.

lastDirInUri

Query terms in the last part of the item URI.

quality

The proximity of the item to the root of the indexed system.

sourceReputation

The rating of the source the item resides in.

summary

Query terms in the summary of the item.

This key is the equivalent of the Administration Console’s Keyword in summary ranking factor.

termCorrelation

Query term correlations within stemming classes in the item.

termCasing

Query term casing in the item.

TFIDF

Term frequency-inverse document frequency.

This key is the equivalent of the Administration Console’s Keyword frequency ranking factor.

title

Query terms in the title of the item.

This key is the equivalent of the Administration Console’s Keyword in title ranking factor.

uri

Query terms in the URI of the item.

Order of Execution

The following diagram illustrates the overall order of execution of query pipeline features:

order of pipeline execution

Required Privileges

By default, members of the Administrators and Relevance Managers built-in groups can view and edit elements of the Query Pipelines (platform-eu | platform-au) page.

The following table indicates the required privileges to view or edit elements of the Query Pipelines (platform-eu | platform-au) page (see Manage Privileges and Privilege Reference).

Action Service - Domain Required access level

View ranking weight rules

Organization - Organization
Search - Query pipelines

View

Edit ranking weight rules

Organization - Organization

View

Search - Query pipelines

Edit


1. (Advanced) You can click Menu, and then select Add a ranking weight rule with code to define the rule using the appropriate QPL syntax.
2. (Advanced) You can click More, and then select Edit code to edit the rule using the appropriate QPL syntax.
What's next for me?