Compound Words

A compound word is a query term that a customer might enter as a single term or a phrase. If a compound word appears in a search phrase as a single term, it's automatically split. Each part of the split word is treated as a separate search term.

The order in which compound words are processed is designed to let the most specific rule override less specific rules. Compound words without wildcards are processed first, from the rules with the smallest number of words to the largest. After this compound words with wildcards are processed, from the smallest to largest number of words in the rule.

Multi-word search terms can be configured as either compound words or common phrases. For example, "t-shirt" is configured as a compound word and "x-mas" is usually configured as a common phrase. Compound Words are not necessarily hyphenated when the customer searches for them. Hyphens are only used when configuring the term so that Salesforce B2C Commerce can recognize them. The difference between compound words and common phrases is how they are processed.

Note: Unlike synonyms, compound words must be entered exactly. For example, singular and plural compound words must be entered separately.

When you create a compound word, you must rebuild the Synonym index for it to appear in the storefront.

You can also configure phrases using quotes, single compound words, or multiple compound words using wildcards.

Simple Compound Words

A simple compound word must include a hyphen (-) and there must be more than one character on each side of the hyphen.

The following are valid compound word definitions:

 work-shirt , ice-cream 

The following definitions result in only the term after the hyphen being searched:

 t-shirt , x-mas, 1-tΓΌrig 

Using Wildcards

A compound word definition can only contain one wildcard. The wildcard must have at least three other characters with it: a hyphen and two characters.

The following are valid compound word definitions:

*-kleid , herren-* , herren-*-hose 

The following definitions are invalid:

* , *-* , *-herren-*  herren-*-* 

Using Phrases

Compound word phrases are enclosed in quotes and require that both terms be found in a searchable attribute. Wildcards are not allowed in search phrases. Phrases must include a hyphen to be valid.

For example, if you configure "work-shirt" then both work and shirt must both be found in a searchable attribute for the product to be returned as a search result.

The following are valid compound word definitions:
"cheese-cake" , "digital-camera" 

The following definitions are invalid:

"ice cream" , "*-shirt" 

Using Synonyms with Compound Words

When a compound word is split into its component parts, any synonyms configured for each individual term apply.

For example, if the following is true:

  • herrenhose is a German compound word.
  • maennerhose isn't a German compound word
  • herren and maenner are synonyms
  • *-hose is specified as a compound word rule
Then any of the following user searches:
  • Maennerhose
  • Herrenhose
  • Hose Herren
  • Maenner-Hose

Return the following products:

  • "Hose fuer Maenner"
  • "Hose fuer Herren"
  • "Herrenhose"
  • "Maennerhose"