Adding and Managing Query Pipeline Ranking Weight Rules

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

The pre-tuned ranking weights used by Coveo Cloud platform indexes for each of the ranking factor have been optimized over years of experience with a wide variety of indexed content to deliver well balanced out-of-the-box relevance scores in most cases.

You can fine-tune one or more of the pre-tuned ranking factors for a specific query pipeline. When you see that the ranking of specific search results isn’t ideal in a specific search context or case, consider adjusting one or more of the available ranking factors.

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

Add a condition to each ranking weight rules so they apply only for the more specific context in which you want to improve relevance.

The following table provides description for the ranking factor that you can tune.

Ranking factor Description

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.

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

Keyword in concepts

The Coveo Cloud platform uses a linguistic algorithm to create a list of the most important concepts found in an item (see the @sysconcept field). The relevance score is increased for items containing keywords in their concepts.

Item last modification

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

Keyword in summary

When indexing an item, the Coveo Cloud platform uses a linguistic algorithm that scans and extracts all 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.

Keyword frequency

The relevance score is increased for items containing a higher number of occurrences of keywords. 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 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.

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

The following diagram highlights the position of ranking weight rules in the overall order of execution of query pipeline features.

Apply ranking weight rules

Access the “Ranking Weights” Tab of a Pipeline

  1. On the Query Pipelines page, access the query pipeline in which you find the ranking weight rules you want to manage:

    • Double-click the pipeline.


    • Click the pipeline, and then in the Action bar, click Edit components.

  2. On the selected pipeline page, select the Ranking Weights tab.

Manage Query Pipeline Ranking Weights

Members with the privilege to view query pipelines (i.e., the View all or the Custom access level on the Query Pipelines domain) can review ranking weight rules in read-only mode (see Privilege Management and Query Pipelines Domain).

For all the other actions you can perform on your ranking weight rules, see Adding and Managing Query Pipeline Rules and Rule Conditions From Tabs.

Add a Ranking Weights Rule

  1. Access the “Ranking Weights” tab of a pipeline.

  2. On the Ranking Weights tab, you can add a new ranking weight rule:

    1. Access the Add/Edit a Ranking Weight Rule dialog by clicking Add Rule, and then selecting Ranking weights rule.

    2. In the Add/Edit a Ranking Weight Rule dialog, for the ranking factor(s) that you want to fine-tune, click and drag the slider to the desired value:

      • 5: default pre-tuned recommended ranking factor value.

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

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

    3. Click Add Rule.

      • Ranking weighs rule changes are now effective on the pipeline.

      • For developers, you can also directly enter a rule that respects the Query Pipeline Language (QPL) syntax for ranking weights (see Ranking Weights):

        1. In the Ranking Weights tab, click Add Rule, and then select Ranking weights with code.

        2. In the Add a Rule With Code dialog, in the form editor box, enter a ranking weights rule.

        3. Click Add Rule.

    Your changes are now effective for queries going through the selected query pipeline.

  3. Back on the Ranking Weights tab, while optional, it’s a good practice to add a condition to the rule to control more precisely when this rule applies:

    1. Access the Select a Condition panel:

      1. Click an existing or modified rule.

      2. In the Action bar, click More, and then select Select condition or Change condition.

    2. In the Select a Condition panel that appears:

      • Add a condition to apply (see Create a condition).


      • Select an existing condition to apply.

        The selected condition is now effective.

        When there are many conditions, in the filter box, type a word from the condition you’re looking for to refine the list of displayed conditions.

  4. Validate the effect of your ranking weight rule (see Troubleshooting Ranking).

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

Required Privileges

The following table indicates the required privileges to view and edit elements of the Query Pipelines page and associated panels (see Privilege Management and Privilege Reference).

Action Service - Domain Required access level
View ranking weights

Search - Query pipelines

Edit ranking weights

Search - Query pipelines

Recommended Articles