Hello ! A question on typo correction, as some beh...
# community-help
y
Hello ! A question on typo correction, as some behaviours are quite mysterious to me. I have a document with a field name = "La Bouitte". With typo params in the search set to default and exhaustive search set to
true
, the typo correction works differently depending on the position of the typo: • q="bouite" (one t) --> doc is found • q="bouittee" (extra e) --> doc is found • q="boutte" (no i) --> doc is found • q="boitte" (missing u) --> doc is found • q="buitte" (missing o) -->
doc is not found
• q="ouitte" (missing b) -->
doc is not found
• q="ouittee" (missing b, extra e) --> doc is found (I guess because
min_len_2typo
defaults to 2 So inserting a char earlier in the word seems to be harder to correct, why is that so ?
k
👋 When you mean by
doc is not found
do you mean to say that you get no results at all or that you get other results?
y
Hello, yes, no result at all
we made sure that there were no other docs matching these names
k
Would you be able to share a sample dataset where this issue exists?
Also please tell me the version of Typesense you are using.
y
v0.24.1
Copy code
# Example doc
{
  "id": "16421",
  "name": ["la bouitte"],
  "resort": [419,422]
}
Search Request
Copy code
{
  "searches": [
    {
      "query_by": "name",
      "collection": "prod__location",
      "filter_by": "resort:=[419]",
      "q": "buitte",
      "exhaustive_search": true
    }
  ]
}
Create
Copy code
curl --location '<http://localhost:8108/collections>' \
--header 'Content-Type: application/json' \
--header 'X-TYPESENSE-API-KEY: xyz' \
--data '{
         "name": "test",
         "fields": [
            {"name": "name", "type": "string[]"},
            {"name": "resort", "type": "int32[]", "facet": true}
         ]
       }'
Insert
Copy code
curl --location '<http://localhost:8108/collections/test/documents>' \
--header 'Content-Type: application/json' \
--header 'X-TYPESENSE-API-KEY: xyz' \
--data '{
    "name": ["la bouitte"],
  "resort": [419,422]
}'
Search
Copy code
curl --location --globoff '<http://localhost:8108/collections/test/documents/search?q=buitte&query_by=name&filter_by=resort%3A%3D[419]>' \
--header 'X-TYPESENSE-API-KEY: xyz'
Response:
Copy code
{
  "facet_counts": [],
  "found": 0,
  "hits": [],
  "out_of": 1,
  "page": 1,
  "request_params": {
    "collection_name": "test",
    "per_page": 10,
    "q": "buitte"
  },
  "search_cutoff": false,
  "search_time_ms": 0
}
The search works for
buitte l
and for
la buitte
but (as expected, since
l
has no exact match) not for
l buitte
k
Thanks, will investigate and get back to you.
🙏 1