Include rules for search
Include rules for search
In the Search manager of the Coveo Merchandising Hub (CMH), merchandisers can define Include filter rules to ensure that products that meet specific criteria are always included in the search results.
Include filter rules don’t prevent products to be excluded from the search results, nor affect the ranking of the search results. They only ensure that products that meet the specified criteria are included in the search results.
For example, if an include rule specifies that products from the Kayak
category should be included in the search results, products from other categories, such as Kayak paddles
, can still be displayed in the search results.
|
Leading practice
|
Include filter rules can apply to all queries or to specific queries only.
![Include rules | Coveo](/en/assets/images/coveo-for-commerce/images/cmh/cmh-include-rule.png)
Use case examples
Include filter rules can be used to address a variety of use cases. Here are a few examples:
-
For a specific query, you want to ensure that products from a specific category are always included in the search results. For example, when a visitors searches for "Kayak," you want to ensure that products from the
Kayak
category are displayed in the search results. -
When your visitors are searching for a specific brand, you want to ensure that products from that brand are displayed in the search results.
-
You want to ensure that products relevant to the current season are always included in the search results. For example, you want to ensure that products having
summer
as the value of theseason
attribute are displayed in the search results.
Prerequisites
To create rules, merchandisers must ensure they have properly configured their query pipeline and chosen the correct tracking ID to ensure that their changes impact the intended queries.
Create an include rule
To create a rule:
-
In the CMH, access the Search manager.
-
From the navigation tabs, select Filter rules.
-
Click Create filter rule, and then, Depending on whether you want to apply the include rule to a specific query or to all queries, select the appropriate option.
-
Select the Locale for which the include rule will apply. By default, a rule applies to all available locales.
-
Select the Query to which the include rule will apply, and then click Done. Note that if you selected to apply the include rule to all queries, you won’t be able to select a query.
-
Under Choose an action, select Include.
-
Under Attribute, select the attribute on which you want to apply the include rule. For example, if you want to include products based on the
color
attribute, select color. -
Under Operator, select the operator that you want to use.
-
Under Value, select the attribute value that you want to use to filter products. For example, if you want to filter products based on the
color
attribute, enter the color value that you want to use as a filter, such as red. Note that you can select multiple values for the attribute. -
(Optional) If you want to add more attribute-value pairs to the include rule, click Add attribute and repeat the process.
-
Click Done.
Leading practiceYou can preview the effect of your rules by using the Preview panel on the right side of the page. You can use this panel to simulate queries and see how the rule affects the search results for a given locale.
-
Review your rule configuration, and then click Publish.
-
In the Publish now panel, enter a meaningful name for your rule, and then click Publish. The rule now applies.
Manage existing include rules
To manage an existing include rule:
-
In the CMH, access the Search manager.
-
From the navigation tabs, select Include rules.
-
Locate the rule you want to manage.
-
Click Modify. You can now decide to edit the rule or delete it.