Doofinder logo

Support Documentation

Search icon

Synonyms

What is a Synonym?

A synonym is a word that means the same as another word in the same language, for example, "small" and "little" are synonyms.

What is Doofinder’s Synonyms?

Synonyms of Doofinder enhance your results by mapping terms and displaying the synonyms chosen; which means that you can customize Synonyms to make term results match other terms not usually associated with your data feed. You can customize your synonyms at Admin Panel > Search Engines > Business Rules > Synonyms > Add synonyms > Synonyms or explicit replacement > Save. They will be applied and stored in the Index when indexing.

Each search engine has a limit of 1000 synonyms.

The use of a synonym does not guarantee that you will have the same search results applying one and the other. You may get different results or in different order of priority.

Types Of Customization: Synonyms and Explicit Replacement

There are two types of customization: Synonyms and Explicit Replacement.

Synonyms sets will map and associate the chosen terms and display them by association. Explicit replacement will substitute a term with the synonym chosen, so the term replaced will never be found unless searched for with the replacing term.

You will find in-depth information about both types below.

  • Synonyms

As mentioned above, customized synonym sets will return all products contained in the set created. The structure is as follows: “Synonym1, Synonym2, Synonym3”.

For a synonym to work, the first synonym in the set must be an attribute appearing in the feed indexed. Whenever the user searches for one of the synonyms, products containing any of them should match as a search result.

Commas (,) are reserved as a term separator and cannot be used within the synonym chain.

Look at this example: The term must be exact to work, for example, if the indexed term is “icebox”, writing “iceboxes” in your synonym set won’t yield any results. The use of a synonym set does not guarantee the exact same search result.

  • Explicit Replacement

Explicit replacement entails substituting the original word with one or more words. Consequently, if a user searches for the original word, no results will be generated. Instead, results will only appear when employing one of the synonyms chosen.

Synonyms supplement the original word with additional terms. Explicit replacement substitutes one search term for another. Be aware of the effects of explicit replacement as the term replaced, if searched, won’t yield results. The structure is as follows:

Term or terms to be replaced “Term1, Term2, Term3” => term or terms that will replace “Term1, Term2, Term3” The term or terms to replace must exist in the feed indexed for explicit replacement to work.

Here's an example of whow ir works:

In the case of “small camping cooler” nothing is being replaced. Therefore, if you search for “cooler” your search result will be “small camping cooler”

Only the first product is affected, only instances of the icebox word are mapped, cooler or fridge are not replaced. Any occurrence of any element which is at the left of the => operator, is replaced by what is at the right of the => operator.

This is how your Synonyms panel should look like:

  • Special Case: According to how the index building works, there is a special case with hyphens (-): White spaces always replace them. When adding synonyms, they will always be saved using spaces rather than hyphens.

As well as hyphens are replaced by spaces, symbols are removed from tokenizers, so they can't be used generating synonyms.

Import/Export Synonyms

You can import and export a list of synonyms from your admin by clicking on the add synonym drop-down menu in the upper right corner.

The "import" option opens a modal where you can upload the file in .csv format.

The first line of the .csv is not processed, since it is the header line.

Please note that the file must have one line per record and the synonyms must be separated by commas and enclosed in quotation marks, e.g., “sneaker, trainer, shoe”.

If you check the box to replace existing ones, this action will remove the synonyms already created and add the new ones that the file contains. Otherwise, the synonyms will be added over the existing ones.

The "export" option will download a .csv file.

How Does Doofinder Index Synonym Sets Works?

Doofinder, once per day at least (and any time you request it at Indices) crawls through your product feed, extracts the product info from that feed and stores it in a special file called the Index. This process is called indexing.

If a user searches for anything, Doofinder looks for it in that index, because it's built in a way that makes it really quick to find products. When you specify synonyms, Doofinder, while indexing, replace any occurrence of the synonyms by the whole synonyms set, and stores it in the Index.

When Doofinder indexes the products, with the synonyms line we inserted before, this is how (roughly) these products will be stored in the index (this is a human-readable representation to make it clearer).

In a nutshell, Doofinder replaces any occurrence of any defined synonym by all its synonyms.

Did you find this page helpful?