I'm having a search problem on Typesense Cloud v30...
# community-help
r
I'm having a search problem on Typesense Cloud v30.1. I have multiple records with "Division 7" in them. When I search for "Division" they all come up. When I search for "Division 7", none of them come up. I don't think this has anything to do with
token_separators
or
symbols_to_index
, but not positive. Can anyone explain why this is?
Turns out "Division 7" wrapped in quotes works:
a
Hi @Richard Scotten When you use quotes, you are performing an "exact phrase match", which tells Typesense to get that exact string. When unquoted, typesense will do fuzzy searching + treat the last token (in your case '7') as a prefix, subjecting it to max_candidates limit (which defaults to 4). Until here, if no results are found, it will return 0, since is very unlikely to have any word that starts with 7. A few tweaks you can do is: 1. Increase max_candidates to 20 2. use exhaustive_search=true 3. increase drop_token_threshold to 10 If after you try all these tweaks you still can't get it, you can share the cURL requests here and let us know what is the exact behaviour you expect. We can try tweaking it and checking your collection schema.
r
Hi Alan, thanks for your response. I messaged you my cURL request.
Another weird thing, if I misspell "Divisiion" with an extra "i", I get the results I expect:
Also if I add the word "division" twice spelled correctly, I again get the results I expect
a
Hi Richard It seems like your frontend might be adding some weird stuff. In the cURL, the q paramter (which is used for searching), is like this:
q=division+7ion+7
which means the actual search query being sent is "division 7ion 7" (three words) instead of the expected "division 7" (two words). This junk middle word "7ion" doesn't match anything. Typesense then tries to be smart about searching the last word "7", but because the word before it ("7ion") had zero matches, it gives up early and returns nothing. This also explains the weird behavior: • Misspelling "Divisiion" works because the duplication bug produces a different (non-broken) query • Typing "division" twice works for the same reason
r
Thanks, Alan. I sent you a bad example. I just sent you a fresh example for "division 7" without the "ion"