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
Synonyms
-
One-way synonym mappings:
-
laptop
=>notebook
-
laptops
=>notebooks
-
The Rule
We 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.
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.
Results
-
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").
-
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 now trigger the rule.