In Typesense, When i search 'brd' it doesn't show any results. Why it doesn't show results like bird, bard, etc.,?

18 Views Asked by At

In typesense, Why fuzzy search is not woking for small word (len 4)?

const searchParameter = {
   'q': "brd",
   'query_by': 'title',
}

output:

{
    "facet_counts": [],
    "found": 0,
    "hits": [],
    "out_of": 9979,
    "page": 1,
    "request_params": {
        "collection_name": "books",
        "per_page": 10,
        "q": "brd"
    },
    "search_cutoff": false,
    "search_time_ms": 0
}

I want typesense show results, when i search 'brd'

1

There are 1 best solutions below

0
ErJab On

This is because of the default values for the parameter: min_len_1typo which is set to 4.

This is set to 4 as default to reduce noise in the results.

But if you change that parameter to say 2 or 3 for example, you should see brd be auto-corrected.

This is documented here: https://typesense.org/docs/0.25.2/api/search.html#typo-tolerance-parameters