New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange behaviour when searching string with hyphen / dash #349
Comments
Few possible things, just an amateur myself here: The hypen behaviour is based on how PG is splitting up the words. PG uses dictionaries to define how to break up the works into tokens or lexemes: https://www.postgresql.org/docs/9.1/static/textsearch-dictionaries.html By default pg ships with You might want to switch to trigram, might give you better results on similarity instead of prefix matching. |
ping, any idea how to solve it? I'm using my code looks like:
calling
I for sure have objects to be found in my db:
On my db, I have theoretically the necessary extensions:
|
Also find this highly annoying, I didnt expect to get this far and be stopped by a hyphen... my database is mostly model numbers |
Has anyone managed to solve this? I haven't tried |
Hi, I've found very similar issue #19 and possibly related to #117
I have a simple setup:
And these troubles:
I've tried several options but nothing works as expected. I also tried replacing hyphen/dash with space character, then
Product.search_by_name("DS 7604").any? # => true
butProduct.search_by_name("Hikvision DS 7604NI E1/4P/A").any? # => false
Tested with pg 9.6, sorry if it's not related with the gem but I don't know how pg tsearch work yet so trying first shot here. Thanks for help.
The text was updated successfully, but these errors were encountered: