hi Friends of TypeSense. y need help. i send this ...
# community-help
n
hi Friends of TypeSense. y need help. i send this query to index typesense and no understand this result. The query it is "hong kong" and result contain "singapore,singapore" ?????? please help me
j
That's quite a drastic edit distance to be considered a typo. Do you have synonyms set for hong kong?
n
no, i dont have synonyms create.
j
Could you show the contents of the search function?
n
message has been deleted
data in index
j
Could you add
drop_tokens_threshold: 0
to the search parameters and see what the result is after that?
n
ok
ok it worked. Please, can you explain what happened?
j
Let me know if this makes sense: If at least drop_tokens_threshold number of results are not found for a specific query, Typesense will attempt to drop tokens (words) in the query until enough results are found. Tokens that have the least individual hits are dropped first. Set drop_tokens_threshold to 0 to disable dropping of tokens.
So basically in your example, hong and kong were individually dropped, and it ended up matching a seemingly unrelated term
In a future version, we plan to reduce the senisitivity of this feature by default, so it doesn't pick up results like this
The original goal of this feature was to make sure that a search query always returns some results that are somewhat related or close to the search query when no exact matches are found, but over time we've seen this to actually cause confusion
n
aaaa ok ok
thk @Jason Bosco
👍 1
please add this param to documentation
j
It is documented here already (in the table): https://typesense.org/docs/0.21.0/api/documents.html#arguments
n
ok thk for you help
👍 1
👍
k
I just checked what's happening here.
sing
is getting prefix-matched to
kong
because they are within 2-typos away. In the next version of Typesense we've made the default typo correction less "eager" on such small terms to reduce false positives like this.
👍 1
b
Is there an ETA for next version?
k
We don't have a fixed release schedule. We release when we feel that the build is stable and we have covered enough ground. I think we are about 3 weeks away from the next release given current state of things.
👍 1
We do have pre-release builds available for testing and they are generally stable as they are produced only after an exhaustive internal test suite approves them.
c
would it make sense for the number of typos to factor in the word length?
j
Yup, that's exactly what we're doing in the next version to reduce "eagerness".
🙌 1