Add stopwords and synonyms

  • Updated

Stopwords

Stopwords are the common words in language that are ignored when included within a search query. B2B Commerce has a default set of stopwords already included, but you may want to add additional terms to exclude from search query processing. For example, words such as "quality", "cheap", and "value" could be added so that if a user enters a query of "cheap bolts", search only processes "bolts."

The following is the default list of stopwords:

a, an, and, are, as, at, be, but, by, for, if, in, into, is, it, no, not, of, on, or, such, that, the, their, then, there, these, they, this, to, was, will, with

Stopwords are not case sensitive.

Manually add stopwords

  1. Go to Admin Console > Marketing > Search > Stopwords.
  2. Click Add Search Stopword.
  3. Enter the stopword.
  4. Click Save if you only want to add one stopword, or click Save and Add for additional stopwords.

Manually remove a stopword

  1. Go to Admin Console > Marketing > Search > Stopwords.
  2. Click the Edit icon next to the word you want to delete.
  3. Click the Delete icon.
  4. Click Delete when the dialogue appears.

If you need to remove multiple words, click the checkbox next to each word and select the Delete icon in the toolbar.

Import or export stopwords

  1. Go to Marketing > Search > Stopwords.
  2. Click Import.
  3. Click Choose File and select the file to be imported.
  4. Select the desired import options for the import file.
  5. Click Import.

Synonyms

Synonyms allow your customers to have flexibility and variation when searching for products on your website. For example, you offer several types of bubblers on your website, but some are called water fountains, drinking fountains and fountains. The goal is that the search results show all of these variations. You can use synonyms to do this with two option types: Bidirectional and Synonym.

Synonyms are not case-sensitive.

Bidirectional synonyms

You should use a bidirectional synonym when you have multiple products with similar name variations, like with the bubbler example above. The search substitutes all of the listed synonyms for any of the terms a customer searches or when the system indexes the product's data.

In the example, searching for "water fountain" shows products with the terms "water fountain," "drinking fountain," "fountain' or "bubbler." This configuration also shows results for partial matches since the system indexes synonyms as a string, such as searching for "water".

Synonyms

You should use a unidirectional synonym if you think your customers might search for a term but your data represents that term in other ways. For example, if none of the products in your catalog are called "bubbler," but you know some customers may search for this term when looking for water fountains or drinking fountains, set up a unidirectional synonym for "bubbler."

If your data uses abbreviations not commonly searched by customers, you can set up a synonym with the abbreviation. For example, indicate "elbow" as the replacement token for the abbreviation "ELLB" so that the system replaces all searches for "ELLB" with "elbow" in queries and the index.

The synonyms configuration has a number of notable exceptions:

  • Avoid configuring single-character synonyms
  • Avoid creating dimensional synonyms (for example, in=inch or .5=1/2)
  • Avoid creating synonyms only valid for a single or small number of products (such as competitive part numbers). Instead, we recommend adding this data to the product itself and ensuring it is indexed.
  • Avoid creating over 1,000 synonym records as there can be performance implications. If you approach this number, review the use cases with your partner for a more performant approach.

Create synonyms

When creating synonyms, each synonym relationship must be its own record. You can manually add the various relationships into the list, or, if the number or relationships is lengthy, you can create the relationships in an Excel spreadsheet and import it.

To provide context for the instructions below, recall the bubbler scenario above. The goal here is to return any variants of "bubbler" when a customer searches for it.

  1. Go to Admin Console > Marketing > Search > Synonyms.
  2. Click Add Synonym.
  3. Set the Bidirectional toggle to Yes if this synonym should replace any synonym found with all synonym values. Unidirectional synonyms replace any synonym found with all replacement tokens.
  4. Click Add Synonym to enter your synonyms.
It is necessary to rebuild all indexes after updating Synonyms. Go to Marketing > Search > Indexing in the Admin Console and click Rebuild All.

Using the steps above and referring to the provided scenario, the following table illustrates what would need to be included in the synonyms list to satisfy the scenario:

Synonym Synonym Bidirectional
Bubbler water fountain Yes
Bubbler drinking fountain Yes
Bubbler fountain Yes