Synonym rules for search
Synonym rules for search
In the Coveo Merchandising Hub (CMH), merchandisers can create synonym rules to define relationships between query terms.
Synonym rules are used to expand the scope of a query by including additional, equivalent, or replacement terms to the original query terms.
For example, a synonym rule can be created to associate the query term rashguard
with the synonyms swimsuit
and wetsuit
.
![Synonym rules | Coveo](/en/assets/images/coveo-for-commerce/images/cmh/cmh-synonym-rules.png)
Synonym rule types
Using the CMH, merchandisers can create three types of synonym rules:
-
One-way synonym: Defines alternative terms for a specific query term, but doesn’t reciprocate the association.
ExampleA one-way synonym rule can be created to associate the query term
laptop
with the synonymsnotebook
andportable computer
. This means that when a user searches forlaptop
, the query will becomelaptop OR notebook OR portable computer
.Therefore, the search results will include products that contain either the term
laptop
,notebook
, orportable computer
. Note that in this example, if the termnotebook
is searched, the search results won’t include items that contain the termslaptop
orportable computer
. -
Two-way synonym: Defines multiple search terms that are considered equivalent, creating a reciprocal relationship between them.
ExampleA two-way synonym rule can be created to associate the query terms
laptop
,notebook
, andportable computer
with each other. This means that when a user searches forlaptop
, the query will becomelaptop OR notebook OR portable computer
.Therefore, the search results will include items that contain either the term
laptop
,notebook
, orportable computer
. The difference with a one-way synonym rule is that if the termnotebook
orportable computer
is searched, the search results will also include products that contain the termlaptop
. -
Replace synonym: Defines a term that should be replaced by another term.
ExampleA replace synonym rule can be created to replace the query term
laptop
with the termnotebook
. This means that when a user searches forlaptop
, the query will becomenotebook
.
Use case examples
Synonym rules can be used to address a variety of use cases. Here are a few examples:
-
Broaden search results: You want to ensure that more products are returned when a user searches for a specific term. For example, a query like
phone
may not return many results, but by associating it with synonyms likesmartphone
andmobile
, you can ensure that more products are displayed. -
Correct common spelling mistakes: Common spelling mistakes can be corrected by replacing them with the correct term. For example, your visitors may often misspell one of your product names, resulting in no or few search results. By creating a synonym rule that replaces the misspelled term with the correct one, you can ensure that the correct products are returned.
-
Promote specific products: You want to promote specific products when a user searches for a particular term. For example, when a user searches for
Barca Sports
you can add a term likekayak
to their query, promoting Barca Sports kayaks 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 a synonym rule
To create a rule:
-
In the CMH, access the Search manager.
-
From the navigation tabs, select Synonym rules.
-
Click Create synonym rule.
-
Select the Locale for which the synonym rule will apply. By default, a rule applies to all available locales.
-
Under Choose an action, select the synonym rule type that you want to create.
-
Fill in the required fields based on the selected synonym rule type.
-
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 the rule configuration, 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 Synonym rules.
-
Locate the rule you want to manage.
-
Click Modify. You can now decide to edit the rule or delete it.