#community-help

Resolving Typos and Facet Behavior in Typesense

TLDR Dima encountered unexpected behavior when searching with facets, but discovered the typo_tokens_threshold parameter to address the issue.

Powered by Struct AI
+11
smile1
3
6mo
Solved
Join the chat
Mar 13, 2023 (6 months ago)
Dima
Photo of md5-1b62114a658b760944aa7d2b4c274460
Dima
02:18 PM
Hi team! Could you please help me to find a parameter, which controls this behaviour?

I have a dataset with one string facet with values facet1, facet2. If I search “foo bar” without chosen facets, it may return to me document {"facet": "facet1", "text": "foo ba"} and 0 in facet_count for facet2. But if I choose facet2 instead, it will show me more extreme typos, like fow bas. So it looks like typesense when nothing is found switching to more tolerant rules to try find anything. I checked and exhaustive_search is default in my case
02:19
Dima
02:19 PM
It leads to weird behaviour when you can find “white” with “shit” query if you starts to play with facet. And also facet count shows zero, but in reality it returns something and confuses users.
02:25
Dima
02:25 PM
typo_tokens_threshold found it 🤓 Sorry to bother
+11
smile1