Understand the thesaurus

The thesaurus provides a way to include alternate terms for a shopper’s search query.

The thesaurus lets you create the synonyms that capture other ways of expressing queries relevant to your store.

You can add two kinds of synonyms to your thesaurus:

  • One-way thesaurus entries provide alternate ways of expressing query words or phrases that apply in a single direction only.

    For example, you could define a one-way mapping so that all queries for computer would also return matches containing laptop, but queries for laptop would not return results for the more general computer. You can add an unlimited number of synonyms to a one-way entry, and Commerce expands the query to search for each synonym with the same one-way relationship.

  • Equivalent thesaurus entries establish a mutual equivalence relationship between words or phrases. The words and phrases are interchangeable. A query for one term would also return results for all other terms.

    For example, an equivalent might specify that the phrase “notebook” is interchangeable with the phrase “laptop.”

    In the Rest API an equivalent thesaurus entry is known as a multi-way entry. See Configure a thesaurus.

In addition to the user interfaces described in this section, Commerce also provides search REST APIs that you can use to manage your thesaurus. See Configure a thesaurus for more information.

Tips on using the thesaurus

The thesaurus can help customers find products in your store, but poorly conceived entries might not be useful. To maximize the potential of the thesaurus, review the following tips:

  • Do not create thesaurus entries for common spelling corrections. Commerce fixes misspelled words automatically.
  • Do not create equivalent entries with different cases of the same word. The thesaurus is not case sensitive.

    For example, entries such as Tartan = tartan are unnecessary.

  • Do not create an equivalent entry for a word with multiple meanings.

    For example, “khaki” can refer to a color as well as to a style of pants. If you create an equivalent synonym for khaki = pants, then a shopper’s search for khaki towels could return irrelevant results for pants.

  • Do not create an equivalent synonym between a general and several more-specific terms, such as top = shirt = sweater = vest. This increases the number of results the shopper has to go through while reducing the overall accuracy of the items returned. In this instance, if a shopper searches for “vest,” the shopper also gets results for “sweater.”

    You get better results by creating individual one-way entries between the general term “top” and each of the more-specific terms. In that case a search for vests would only return vests, not sweaters, too. Only a search for “top” would return both sweaters and vests.

  • Do not create an entry that includes a term that is a substring of another term in the entry.

    For example, consider an equivalent entry of “tackle” and “bait and tackle.” If shoppers type “tackle,” they get results for “tackle” or “bait and tackle.” These are the same results they would have received for “tackle” without the thesaurus. If shoppers type “bait and tackle,” they get results for “bait and tackle” or “tackle,” causing the “bait and” part of the query to be ignored.

  • Avoid multiple word entries where single-word entries are appropriate.

    In particular, avoid multiple word forms that are not phrases that shoppers are likely to type, or to which phrase expansion is likely to provide relevant additional results. For example, the equivalent entry “King Aethelbert of Wessex” = “King Athelbert of Wessex” should be replaced with the single-word entry Aethelbert = Athelbert.