#community-help

Resolving Typo Tolerance in Search Functionality

TLDR GM asked how to refine a search query. Jason advised on how to control typo tolerance parameters. GM confirmed the solution worked.

Powered by Struct AI

1

4
2mo
Solved
Join the chat
Jul 27, 2023 (2 months ago)
GM
Photo of md5-9f364f57af6f71faaf6ea963342ef3f6
GM
08:03 PM
Hi Team ,this is my code      searchParameters.q = `~${category}~`;
      searchParameters.query_by = 'category';  if i search "burg" i am getting "burn" also photic values too. How to restrict. Contain search i am trying  

Jason Kishore Nallan
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:07 PM
This is the default typo tolerance kicking-in. You can control this behavior using the num_typos, min_len_1typo, min_len_2typo and typo_tokens_threshold parameters: https://typesense.org/docs/0.24.1/api/search.html#typo-tolerance-parameters

If you want to turn off typo tolerance, you want to set num_typos: 0 and typo_tokens_threshold: 0
GM
Photo of md5-9f364f57af6f71faaf6ea963342ef3f6
GM
08:09 PM
thanks let me check..now
Jul 31, 2023 (2 months ago)
GM
Photo of md5-9f364f57af6f71faaf6ea963342ef3f6
GM
02:46 PM
it worked thanks Jason

1