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

Use fuzzy search ordering #861

Open
KraXen72 opened this issue Aug 29, 2024 · 6 comments
Open

Use fuzzy search ordering #861

KraXen72 opened this issue Aug 29, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request ui Related to app UI

Comments

@KraXen72
Copy link

KraXen72 commented Aug 29, 2024

I search for a song called 'Rain' and it's like halfway down the list?
shouldn't an exact match be at the top?
Screenshot_20240829-203250_Auxio.jpg

(i was looking for the one at the bottom)

it's neither really a bug or feature request so that's why i didn't use the template

@OxygenCobalt
Copy link
Owner

Currently I sort alphabetically. I need to rank/filter by some kind of fuzzy search algorithm, but I've yet to find one that's very reliable (other than uFuzzy, which is JavaScript :/) @KraXen72

@KraXen72
Copy link
Author

time to port uFuzzy to kotlin

@OxygenCobalt
Copy link
Owner

Well, I can also embed it using an interpreter like Rhino, if I'm willing to bite anywhere from 0.5-1mb of app size, possible IPC weirdness, and having to polyfill in Intl since uFuzzy needs it. But otherwise it's kind of possible. It's about as intensive as a port.

@OxygenCobalt OxygenCobalt added the enhancement New feature or request label Sep 4, 2024
@OxygenCobalt OxygenCobalt changed the title Uinintuitive search result sorting Fuzzy search ordering Sep 4, 2024
@OxygenCobalt OxygenCobalt changed the title Fuzzy search ordering Use fuzzy search ordering Sep 4, 2024
@OxygenCobalt OxygenCobalt added the ui Related to app UI label Sep 4, 2024
@OxygenCobalt OxygenCobalt self-assigned this Nov 30, 2024
@leeoniya
Copy link

leeoniya commented Dec 7, 2024

if you end up porting uFuzzy, let me know. i'll add it to the readme ;)

Intl is used only as the last sorting metric (when all other match metrics are equal). you can always use something else that does lexicographic comparisons.

EDIT: i guess the alpha.toLocaleUpperCase() may also use Intl internally. would be easy to provide pluggable endpoints for swapping out the few intl-reliant bits.

@KraXen72
Copy link
Author

KraXen72 commented Dec 7, 2024

@OxygenCobalt
Copy link
Owner

Eh, I'm not going to go wild bringing in a bunch of third-party stuff for this library just set @KraXen72.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ui Related to app UI
Projects
None yet
Development

No branches or pull requests

3 participants