#community-help

Issues and Workarounds for Typesense's Typo Tolerance Feature

TLDR John found unexpected results with Typesense's typo tolerance feature. Jason explained it is the feature's design and suggested a workaround that could potentially yield more results than desired.

Powered by Struct AI

1

5
1mo
Solved
Join the chat
Aug 24, 2023 (1 month ago)
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
05:11 PM
Hey, came across some behaviour which is maybe expected from the Typesense PoV, but very unexpected for the user.

If you search and reach the typo_tokens_threshold and subsequently apply a filter, you may get many more results than you had before you applied the filter. See this pastebin for an example.

What are your thoughts around this? Is there some good workaround?
Image 1 for Hey, came across some behaviour which is maybe expected from the Typesense PoV, but very unexpected for the user.

If you search and reach the `typo_tokens_threshold` and subsequently apply a filter, you may get many more results than you had before you applied the filter. See <https://pastebin.com/aGfWsvRY|this pastebin> for an example.

What are your thoughts around this? Is there some good workaround?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:08 PM
Yeah that’s the typo tolerance feature working by design… You could increase typo_tokens_threshold to a large number to pull up the same typo corrected results for the non-filtered use-case as well
Aug 29, 2023 (1 month ago)
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
09:34 AM
But from the user perspective you don't expect to receive more results after filtering than before :thinking_face:

1

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:56 PM
Yeah... it's a bit non intuitive. Did you try setting typo_tokens_threshold to a large number?
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
02:57 PM
That would fix this but it would lead to more results than desired in most cases, we found that ~5 is typically quite good for our use-case