Skip to content
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

playlist filter is too strict #303

Open
goto-bus-stop opened this issue Nov 16, 2018 · 4 comments
Open

playlist filter is too strict #303

goto-bus-stop opened this issue Nov 16, 2018 · 4 comments
Milestone

Comments

@goto-bus-stop
Copy link
Member

goto-bus-stop commented Nov 16, 2018

Searching for 'royks' doesn't match 'röyksopp' and 'nu'est' doesn't match 'nu’est' (different quote character).

maybe mongo has an option for this. else we need a separate field on playlist items, searchValue or something, that strips punctuation and removes diacritics or does some other form of normalization. there's almost certainly modules for that!


A possible direction here is creating a text index:

ensureIndex({ artist: 'text', title: 'text' })
@goto-bus-stop
Copy link
Member Author

also "4minute crazy" doesn't find the song you'd expect it to because search only matches the full string against artist and title fields separately. but 4minute should match an artist and crazy should match a title. a searchValue field would address this too.

@goto-bus-stop goto-bus-stop added this to the v1 milestone Aug 5, 2020
@goto-bus-stop
Copy link
Member Author

MongoDB's full text search does not work great for this in my tests. If you type half a word it doesn't match anything. We probably need either something custom, or a separate search-optimized database.

@fawaf
Copy link
Member

fawaf commented Mar 25, 2021

does this basically mean fuzzy searching will be a thing? that would be awesome!

@goto-bus-stop
Copy link
Member Author

goto-bus-stop commented Mar 26, 2021

Depends on what level of fuzziness you're looking for 😄

I'm looking at something like Sonic. It will match results even when there are some typos, but it's not the type of fuzzy search you get in tools like fzf.

e; oh … this describes an approach that might yield good results with mongodb only: https://medium.com/xeneta/fuzzy-search-with-mongodb-and-python-57103928ee5d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants