Yoann Couble
06/02/2023, 8:05 AMtrue
, 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 ?Kishore Nallan
06/02/2023, 8:11 AMdoc is not found
do you mean to say that you get no results at all or that you get other results?Yoann Couble
06/05/2023, 8:05 AMYoann Couble
06/05/2023, 8:05 AMKishore Nallan
06/05/2023, 1:45 PMKishore Nallan
06/05/2023, 1:45 PMYoann Couble
06/06/2023, 12:09 PM# Example doc
{
"id": "16421",
"name": ["la bouitte"],
"resort": [419,422]
}
Search Request
{
"searches": [
{
"query_by": "name",
"collection": "prod__location",
"filter_by": "resort:=[419]",
"q": "buitte",
"exhaustive_search": true
}
]
}
Yoann Couble
06/06/2023, 12:20 PMcurl --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
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
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:
{
"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
}
Yoann Couble
06/06/2023, 12:23 PMbuitte l
and for la buitte
but (as expected, since l
has no exact match) not for l buitte
Kishore Nallan
06/06/2023, 12:23 PM