core
core copied to clipboard
playlist filter is too strict
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' })
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.
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.
does this basically mean fuzzy searching will be a thing? that would be awesome!
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