For some languages, the engine will decompound (split) compound words. Compound words are automatically split within:
- All queries in which
queryLanguagescontains one of the six supported languages - All attributes configured in
decompoundedAttributes.
Synonyms, however, are not decompounded and can cause unexpected behaviours. Here are some examples:
Your query is decompounded
A synonym may not work as expected if you search the decompounded version of a compound word, the synonyms will not be triggered.
For example, if you have a synonym kleingeld <-> münzen and search for klein geld, the synonym won’t apply.
Your compound synonym is indexed in a decompounded attribute
Similar to the above example, if you have a synonym kleingeld <-> münzen and expect that searching for münzen will match the record that includes the word kleingeld in the name attribute.
The synonym will not apply if the name attribute is included in the index's decompoundedAttributes as the values in the attribute name are being decompounded at indexing time.
To resolve this you can edit the synonym to contain the decompounded version of the word kleingeld <-> münzen <-> klein geld .
Synonym creates a conflict
If you have a synonym that combines a compound word, the two word decompounded phrase and one of the individual words, this will create a conflict and can lead to unexpected results. You should therefore remove any single word synonym from the set that is being contained in the compound word.
For example
"soccerball" <=> "soccer ball" <=> "soccer".
In this example, you should remove the word soccer from the synonym.
If the single word is needed, you can consider,
One-way synonyms
Replace Word rules (Why are Synonyms not working properly with multi-word synonym matching? )
Keyword attributes as an alternative to synonyms (Synonyms - Algolia )
Using a Query with
containsinstead ofisrule
For a full list of common synonym issues, troubleshooting topics and best practices, see our summary article here.