Feature: Add Option for Fuzzy/Flexible App Search (e.g. handles typos) (issue #2461)#2465
Feature: Add Option for Fuzzy/Flexible App Search (e.g. handles typos) (issue #2461)#2465fibreditoniocartonio wants to merge 1 commit intoNeamar:masterfrom
Conversation
marunjar
left a comment
There was a problem hiding this comment.
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.
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.
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.
or something containing "similar"?
| } | ||
|
|
||
| // Match against app name | ||
| int distance = substringLevenshteinDistance(queryNormalized.codePoints, pojo.normalizedName.codePoints); |
There was a problem hiding this comment.
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.
i think jaro/jaro-winkler is faster
|
Turning on this feature still doesn't work . |
|
This PR is inactive because it has been open 60 days with no activity. |
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.