--- title: Synonym rules for search slug: o5se0082 canonical_url: https://docs.coveo.com/en/o5se0082/ collection: coveo-merchandising-hub source_format: adoc --- # Synonym rules for search In the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/), merchandisers can create _synonym_ rules to define the relationships between [query](https://docs.coveo.com/en/231/) terms. Synonym rules are used to expand the scope of a query by including additional, equivalent, or replacement terms with 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 rule for search | Coveo](https://docs.coveo.com/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. **Example** A one-way synonym rule can be created to associate the query term `laptop` with the synonyms `notebook` and `portable computer`. This means that when a user searches for `laptop`, the query will become `laptop OR notebook OR portable computer`. Therefore, the search results will include products that contain any of the term `laptop`, `notebook`, or `portable computer`. Note that in this example, if the term `notebook` is searched, the search results won't include [items](https://docs.coveo.com/en/pa8f6515/) that contain the terms `laptop` or `portable computer`. * **Two-way synonym**: Defines multiple search terms that are considered equivalent, creating a reciprocal relationship between them. **Example** A two-way synonym rule can be created to associate the query terms `laptop`, `notebook`, and `portable computer` with each other. This means that when a user searches for `laptop`, the query will become `laptop OR notebook OR portable computer`. Therefore, the search results will include [items](https://docs.coveo.com/en/pa8f6515/) that contain any of the terms `laptop`, `notebook`, or `portable computer`. The difference with a one-way synonym rule is that if the term `notebook` or `portable computer` is searched, the search results will also include products that contain the term `laptop`. * **Replace synonym**: Defines a term that should be replaced by another term. **Example** A replace synonym rule can be created to replace the query term `laptop` with the term `notebook`. This means that when a user searches for `laptop`, the query will become `notebook`. ## 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 like `smartphone` and `mobile`, 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 the term `kayak` to their query, promoting Barca Sports kayaks in the search results. ## Prerequisites Before you create rules in the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/): * In the [Coveo Administration Console](https://docs.coveo.com/en/183/), [map](https://docs.coveo.com/en/217/) the [metadata](https://docs.coveo.com/en/218/) that you want to use as attributes in rules to the corresponding [fields](https://docs.coveo.com/en/200/). These [fields](https://docs.coveo.com/en/200/) must have the **Facet** or **Multi-value facet** option enabled. For example, to use the `color` [metadata](https://docs.coveo.com/en/218/) as an attribute in a rule, [map](https://docs.coveo.com/en/217/) it to a [field](https://docs.coveo.com/en/200/) with the **Facet** or **Multi-value facet** option enabled. * [Create query pipelines](https://docs.coveo.com/en/o48e0216#storefront-associations-and-query-pipelines). * [Choose the correct property](https://docs.coveo.com/en/o6lb0453#property-and-locale-selectors) to ensure that your changes affect the intended queries. ## Create synonym rules To create synonym rules . In the CMH, access the **Search** manager. . From the navigation tabs, select **synonym rules** and then click **Create synonym rule**. . Under **This rule will apply to**, define the scope of the rule. .. **Locale**: Select the [locale](https://docs.coveo.com/en/p4tf0351/) that the synonym rule applies to. By default, a rule applies to all available [locales](https://docs.coveo.com/en/p4tf0351/). . Under **Choose an action**, select the [type of synonym rule](#synonym-rule-types) that you want to create. . Fill in the required fields based on the selected synonym rule type. . Click **Next**. . Review your rule configuration. > **Leading practices** > > Use the panel on the right to preview how the rule affects the search results for a given [locale](https://docs.coveo.com/en/p4tf0351/). > > The preview is an approximate simulation that won't cover every scenario encountered in a live environment. . Click **Publish now**. The rule now applies. ## Modify synonym rules To modify synonym rules . In the CMH, access the **Search** manager. . From the navigation tabs, select **Synonym rules**. . Locate the rule that you want to modify. . Click [dots], then click **Modify**. . You can modify the synonym terms. These are the same fields covered in the [rule creation](#create-synonym-rules) section. > **Important** > > You can't change the scope or [type](#synonym-rule-types) of a synonym rule after its creation. . When you've finished editing the rule, click **Next**. . Click **Publish now**. The modified rule now applies. ## Delete synonym rules To delete synonym rules . In the CMH, access the **Search** manager. . From the navigation tabs, select **synonym rules**. . Locate the rule that you want to delete. . Click [dots], and then click **Delete**. . Click **Delete** again to confirm. The rule is deleted.