[Bug] Fuzzy search inconsistencies
The album is literally there, searching for Vaseline gives no results.
https://github.com/user-attachments/assets/8da8141d-d245-4e3e-b6a6-ca3e27ffb8bc
Fuzzy search is implemented by the fuse-swift library which is unmaintained and archived.
However, I did find https://github.com/ukushu/Ifrit which is a fork of fuse-swift with several bug fixes. Changing the dependency should not require any code changes besides changing an import statement.
Maybe this is worth a try @BLeeEZ?
I moved from fuse to Ifrit in 315b80f134fe8eda97bf8aa52b918372b5dc839f. Thank you for mentioning this. I wasn't able to reproduce this issue so I am not sure that this switch does fix the issue. Let's find out in the upcoming beta.
Alright I guess the fix is not in iOS v1.2.2 (1) as it behaves the same.
Ifrit is used in v1.2.2 (1). It seems that this did not fixed the issue.
Just an update, these are some really weak results.
home agai gives both tracks I'm looking for:
home again however only gives one result…
I researched a bit and I'm pretty sure your problems stem from this line in FuzzySearcher:
if let result = result, result.score <= Self.fuzzyMatchThreshold
Where fuzzyMatchThreshold is set to 0.2. If I for example search my music collection for Home Version, I get the following results:
score: 0.30333333333333334 :: Aisumasen (I'm Sorry) [Home Version]
score: 0.42333333333333334 :: Bring on the Lucie (Freda People) [Home Version]
score: 0.18333333333333335 :: Meat City [Home Version]
From these three results I only see Meat City, since this is the only one with a score below 0.2. I think the score is somehow based on the length of the string. Since both of your titles are long, the score is high.
I propose we change the code to remove the threshold completely. Since we are already sorting the results based on the score, the SearchVC will only display the prefix, that is the first (best) 10 results for each song / album / artist.
@BLeeEZ what do you think? Any particular reason why we need the threshold?
@bbsixzz did this solve your problem? I think the fix should be in the latest testflight beta
Yeah it's great!