This message was deleted.
# community-help
s
This message was deleted.
j
The parameters are documented under this section: https://typesense.org/docs/0.25.1/api/search.html#search-parameters
max_candidates
is technically unrelated to typo tolerance
Let me know if something in the docs is unclear for those parameters
n
max_candidates
says “Control the number of words that Typesense considers for typo and prefix searching .” Say if I have a query “tastes blanf” and
max_candidates
is set to 1 then I would expect “blanf” to be considered for typo and any documents with “bland” will be considered hits. If
max_candidates
is set to 0 then “blanf” is not considered for typo and documents with “bland” will not be considered for typos.
num_typos
says “Maximum number of typographical errors (0, 1 or 2) that would be tolerated.“. Does this refer to the number of characters that are allowed to be different in all the tokens or the number of words allowed to have 1 or 2 character typos? I say 1 or 2 only because I see only
min_len_1typo
and
min_len_2typo
as possible delta allowed in edit distance.
k
Num typos works at word level. For each word in query it controls how many typos a candidate word can have to be matched.
n
Umm, still a bit confused. Let me read the docs again and I’ll get back with an example if its still not clear.
k
Given a query like "alpha beta" and num_typos:1, it will match against "alpa bata" because each word in the query is within 1 edit distance away. Now if the dataset had multiple words that were within 1 edit distance away from each of the words in the query, then max candidates is used to decide how many words must be considered for each word in the query.
n
In your example if max_candidates is set 1. And say we have
alpha
,
alpa
,
alkha
in our documents then we will only match for
alpha
the original word and
alpa
.
alkha
will be ignored because we are allowing only 1 candidate to be considered. Is my understanding correct?
k
Yes
👍 1
n
one more tiny follow up, for words at the same edit distance how do you limit if my max_candidates is set less than the possible alternates available? will the longest one be chosen first or the most frequent one or some other way?
k
Most frequently occuring
👍 1
If a default_sorting_field is used, we use that score
👍 1
a
@Kishore Nallan how to handle case sensitive in typesense
k
We don't support case sensitive searching.