Algolia considers matches up to one degree of separation from the initial keyword used to trigger a rule. In other words, the rule applies when a query matches the keyword by either:
- Synonym
- Plural
- Typo
..but not when a query involves multiple factors combined.
Example scenario
We have a the one way synonyms:
-
laptop>notebook -
laptops>notebooks
We also have a rule that triggers when the query is "notebook".
When triggered, this rule pins specific products (e.g. a featured notebook model) to the top of the search results. Based on this setup, you would expect the following behavior for each query:
-
Query: "notebook"
- ✅ Triggers the rule (Direct match)
-
Query: "notebooks"
- ✅ Triggers the rule (Plural of "notebook")
-
Query: "laptop"
- ✅ Triggers the rule (Synonym of "notebook")
-
Query: "laptops"
- ❌ Does NOT trigger the rule (Even though "laptops" is a synonym of "notebooks," and "notebooks" is a plural of "notebook").
The checkbox "Apply to plurals, synonyms, and typos" means the rule will trigger if the query is a plural, synonym, or typo of the keyword, but only one of these transformations at a time.
Why doesn't "laptops" trigger the rule?
The path from "laptops" to the rule’s keyword "notebook" looks like this:
"laptops" > (synonym of) > "notebooks" > (plural of) > "notebook"This is a two-step connection:
- Synonym step: "laptops" > "notebooks"
- Plural step: "notebooks" > "notebook"
Because Algolia rules consider only one degree of separation, the query "laptops" is too far removed to trigger the rule.
How to fix the issue?
By adding the query "notebooks" as an additional condition to the rule, this will ensure that both "laptop" and "laptops" will trigger the rule.
For a full list of common synonym issues, troubleshooting topics and best practices, see our summary article here.