Hello everyone, i have a quick question regarding ...
# community-help
p
Hello everyone, i have a quick question regarding the typo tollerance in a text search. I have two products both with a similar number one has the number
605497
and the other has the number
605490
, as you can see the only difference is the last digit. So if i search be one and turn the
number of typos
to 1 i should get both results right? However this is not the case, these are the queries i am using:
Copy code
{
  "q": "605497",
  "page": 1,
  "per_page": 10,
  "include_fields": "number",
  "filter_by": "id:*",
  "query_by": "number",
  "num_typos": 1
}
Copy code
{
  "q": "605490",
  "page": 1,
  "per_page": 10,
  "include_fields": "number",
  "filter_by": "id:*",
  "query_by": "number",
  "num_typos": 1
}
The number field is of type string, is indexed and sortable. The results of the first and second queries are appended as an image. What am i missing here? Thank you in advance. 😁
1
f
Which version of Typesense are you using?
p
I am using version: 29.0
f
Is the
number
field an int32 field or is it a string field?
If the
number
field isn't a string field then it shouldn't be searchable. Also, there's no reason to just filter by
id:*
, since all that does is match every single id inside the collection
Otherwise, setting
exhaustive_search=true
will match both documents, even though the engine has found at least one exact match
p
Exhaustive search did the trick thank you very much. 👍
I am sorry to nag once again. This works better with exhaustive search but still not they way i imagined. With exhaustive search turned on i get way more matches but it still does not match the
605490
product, also yes the number is a
string
field and i just forgot to take the filter out, for this example.
My bad i didnt check all the pages. 😓