Learn how you can specify custom synonyms that will be applied when indexing.

First go to Search Engines, choose one from the list and then navigate to the Synonyms tab.

Quick & Dirty

You specify synonyms by adding synonyms lines. Each synonym line contains words that doofinder should consider synonyms.

You can use simple comma-separated synonyms (fear, frightened, scared) or explicit mappings (mp3 player => ipod, i-pod, i pod).

One example

Say you have three products:

  • Thick cotton bandage
  • Special heavy machinery handling gloves
  • Low temperature air conditioner

and you have specified the following synonyms line at the doofinder administration:

fat, thick, heavy

Whenever the user searches for fat, thick or heavy, documents containing any of these words should match as search result:

  • If the user searches for thick he will get the products thick cotton bandage and special heavy machinery handling gloves as results
  • If the user searches for fat or heavy, doofinder will return results for those two products, too.

Notice: Please note that the comma (,) can’t be included in the synonym chain as it is the term separator.

How it really works. Replacement while indexing.

Doofinder, once per day at least (and any time you request it at its Product Feed admin section), 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.

When an 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 stuff.

When you specify synonyms, doofinder , while indexing, replace any occurrence of any of the synonyms by the whole synonyms set, and stores it in the index.

Let’s have a look at the previous three products we were talking about. When doofinder indexes those three 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).

(thick, fat, heavy) cotton bandage
Special (thick, fat, heavy) machinery handling gloves
Low temperature air conditioner

You can see now that either if you look for thick, fat or heavy , you’ll get the two first products in your search results.

In a nutshell: Doofinder replaces any occurrence of any defined synonym by all its synonyms. Or , in other words, doofinder maps any synonym to all its synonyms.

Advanced use: Explicit mappings

Now that you’re familiar with some of the synonyms innings, we’ll show you some more advanced use of it: explicit mappings.

You can be more specific, and tell doofinder how exactly you want it to replace words when indexing, by using the =>; symbol.

An explicit mapping would be like this:

i_pod => ipod, i pod

Doofinder will then replace all occurrences of i_pod for both ipod and i pod.

If your products are:

  • red i_pod shell
  • ipod earphones

After indexing, they will look like:

red (ipod|i pod) shell
ipod earphones

Notice two things:

  • Only the first product is affected, only occurrences of the i_pod word are mapped. ipod or i pod are not replaced.
  • If the user searches for i_pod he will get no results.

In general terms, 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 means that, according to our simple synonyms specification format.

thick, fat, heavy

is equivalent to

thick, fat, heavy => thick, fat, heavy

Attention to a special case

According to how the index building works, there is a special case with hyphens (-): They are always replaced by white spaces. So, when adding synonyms, they will always be saved using spaces rather than hyphens. Let’s see another example. If you try to save this synonyms:

i-pod, ipod, music player

What will be saved instead will be:

i pod, ipod, music player

Don’t worry if, after clicking Save you see i pod instead of i-pod. The index will also have hyphens replaced this way.

All this means that if you search for i-pod, according to this synonyms, you will also get in your results list, this item:

Special Apple Ipod Touch

as it was indexed this way:

special apple (ipod|i pod|music player) touch

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