-
-
Notifications
You must be signed in to change notification settings - Fork 624
Feature: Add Option for Fuzzy/Flexible App Search (e.g. handles typos) (issue #2461) #2465
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
base: master
Are you sure you want to change the base?
Conversation
marunjar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Encapsulation is missing, levenshtein is currently used for apps only.
Can you add some basic test like FuzzyScoreV1Test and FuzzyScoreV2Test to show/test behaviour too?
| } | ||
|
|
||
| FuzzyScore fuzzyScore = FuzzyFactory.createFuzzyScore(this, queryNormalized.codePoints); | ||
| boolean flexibleFuzzy = prefs.getBoolean("enable-fuzzy-search", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please encapsulate new search same way as other search algorithm?
This way it's just working for apps, but there are lots of other places using fuzzy search like shortcuts, contacts (surname, last name, nickname, ...) and some others. Also refresh of results needs it at some point.
See FuzzyFactory, there you can return new implementation of FuzzyScore including levenshtein.
| <string name="contacts_name">Contacts</string> | ||
| <string name="contacts_call_on_click">Click to call contacts</string> | ||
| <string name="search_results_options">Search results</string> | ||
| <string name="fuzzy_search_name">Enable fuzzy search</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would change "Fuzzy" in text to something else, as this is misleading.
Current search algorithm is fuzzy and the other one too.
Difference is that one is just not checking if words are similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Typo tolerant search"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or something containing "similar"?
| } | ||
|
|
||
| // Match against app name | ||
| int distance = substringLevenshteinDistance(queryNormalized.codePoints, pojo.normalizedName.codePoints); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how this behaves in terms of performance with 5k contacts. I remember Levenshtein isn't computationally free, so I'll be curious to test this with live data :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think jaro/jaro-winkler is faster
|
Turning on this feature still doesn't work . |
What does this PR do?
This pull request introduces an optional "fuzzy search" feature to the app search functionality. This allows for more flexible and typo-tolerant app searching. For example, a search for "Qhattsapp" will now correctly match "WhatsApp".
This addresses issue [Link to the issue, if one exists].
Why is this change being made?
The current search algorithm requires an exact match, which can be unforgiving of minor typos. This can slow down users who rely on quick, keyboard-based app launching.
By implementing a fuzzy search option, we can significantly improve the user experience by making the search more intuitive and forgiving of errors. This change brings KISS Launcher's search capabilities in line with other minimalist launchers that offer similar flexible search algorithms.
How is this implemented?
How can this be tested?
Settings > Search Settings.