core icon indicating copy to clipboard operation
core copied to clipboard

playlist filter is too strict

Open goto-bus-stop opened this issue 7 years ago • 4 comments

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 avatar Nov 16 '18 12:11 goto-bus-stop

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 avatar May 01 '20 13:05 goto-bus-stop

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.

goto-bus-stop avatar Mar 24 '21 14:03 goto-bus-stop

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

fawaf avatar Mar 25 '21 05:03 fawaf

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

goto-bus-stop avatar Mar 26 '21 15:03 goto-bus-stop