Rule ranking and consolidation

In Sitecore Search, a page contains widgets and each widget can have multiple variations with rules. The rules in a variation become available only when the variation has an Active status.

At runtime, rules are selected, ranked and consolidated as follows:

  1. Only widgets on the Active page variation are available.

  2. Each widget on the Active page variation inherits the rules of the Active global widget variation and the rules of the Active variation of every widget on the page.

  3. Based on the site and visitor context, for each widget, the system ranks the rules applicable in both the Active widget variation and the Active global variation.

Note

The system ranks rules every time the Active variation or context conditions change. In most cases, the system skips ranking when you provide a static ranked list.

Example: Widget with multiple rules

On the Widget Variation page, the Rules tab lists rules in order of priority, including:

  • All rules added to the widget variation.

  • All rules from the active global widget variation.

The following image shows a widget variation with four rules. Each row, or rule, has a column dedicated to each rule section: Context, Strategy, and Settings. The Rank column displays the priority the rule will have during application. If there is conflict between two rules, Conflict appears in the rule card. If you hover your cursor over this icon, you'll receive a warning message.

Ranked rules in a widget variation.

The following table describes the ranked rules in the screenshot. The results can include the videos and books on Constitution, Canadian Constitution, and US Constitution.

Rank

Widget

Description

4

Global widget.

When the browsing locale is en_us or en_ca, always boost results whose topic attribute is set as Constitution.

3

Widget.

When visitor is browsing from Canada, block or exclude results whose topic attribute is set as US Constitution.

2

Widget.

When visitor is browsing from US, block or exclude results whose topic attribute is set as Canadian Constitution.

1

Widget.

When the browsing locale is not en_us or en_ca, exclude results whose content_type attribute is set as video.movie.

Note

Rules are applied bottom-up. A rule with a lower rank number overrides the previously applied rules. To override the assigned ranking, drag a rule up or down.

The following table describes how these rules and behaviors are consolidated by Context for visitors browsing in the US:

Context

Rule and behavior

For those browsing in the US and using the English US locale site.

  • Locale: en_us

  • Location: Within the US

Rule ranked 1: They will see all content types.

Rule ranked 2: Excludes all content with Canadian Constitution as topic.

Rule ranked 3: Does not apply.

Rule ranked 4: Books with Constitution as topic are moved to the top.

For all others browsing in the US and not using the English US locale site.

  • Locale: es_es

  • Location: Within the US

Rule ranked 1: They will not see any content of type video.

Rule ranked 2: Excludes all content with Canadian Constitution as topic.

Rule ranked 3: Does not apply.

Rule ranked 4: Does not apply.

The following table describes how the rules and behaviors for visitors browsing in Europe:

Context

Rule and behavior

For those browsing from Madrid, Spain using the English US locale site.

  • Locale: en_us

  • Location: Madrid, Spain

Rule ranked 1: They will see all content types.

Rule ranked 2: Does not apply. Can see all content with Canadian Constitution as topic.

Rule ranked 3: Does not apply. Can see all content with US Constitution as topic.

Rule ranked 4: All content with Constitution as topic are moved to the top.

For those browsing from Madrid, Spain and not using the English US locale site.

  • Locale: es_es

  • Location: Madrid, Spain

Rule ranked 1: They will not see any content of type video.

Rule ranked 2: Does not apply. Can see books with Canadian Constitution as topic.

Rule ranked 3: Does not apply. Can see books with US Constitution as topic.

Rule ranked 4: Books with Constitution as topic are moved to the top.

Example: Multiple page and widget variations

In the following example, there is a page with two variations called PAGE_X and PAGE_Y each with widgets. Widgets A, B, and C have at least 2 variations each.

Diagram of how page and widget variations are consolidated at runtime.

Based on the status of every variation, the visitor sees the following:

  • Page variation PAGE_X showing widget variations A2 and B1.

  • Widget variation A2 because its status is Active.

  • Widget variation B1 because its status is Default and widget B does not have an active variation. B1 is Active by default.

Note

The visibility of a variation depends on its variation status.

Example: Widget variations with multiple rules

In the following example, there is a page with one widget. The widget has only one variation with two rules. The default variation of the global widget has one rule.

Diagram showing how variation rules are consolidated at runtime.

When widget variations are Active and the Context 1 conditions are met, the following rules are applied:

  • For widget variation A2 Rule A2-R1 (Block), Rule A2-R2 (Sorting), and Rule A2-R3 (Boosting).

  • For widget variation B1 Rule B1-R1 (Bury) and Rule G1-R1 (Block)

Do you have some feedback for us?

If you have suggestions for improving this article,