Bug 512400

Summary: Substring matches for name anchored at the beginning of the string are outscored by substring matches for name in the middle of the string
Product: [Plasma] krunner Reporter: Connor Chang <connorc0627>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.lohnau, apfelkuchen-public, bugseforuns, casta+kde, connorc0627, ilikefoss, kdedev, madness742, natalie_clarius, nate, postix, putr4.s
Priority: HI Keywords: regression, usability
Version First Reported In: 6.5.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=511078
https://bugs.kde.org/show_bug.cgi?id=512399
Latest Commit: Version Fixed/Implemented In: 6.5.5
Sentry Crash Report:

Description Connor Chang 2025-11-20 18:09:01 UTC
More search issues, after
Bug 512399
Bug 511078
Bug 511235
Bug 511237

When I type ala for alacritty, the results are:
- Palapeli
- KAlarm
- Alacritty
When Alacritty should really be the first, which is the behavior in plasma 6.4.4

This seems to be quite a significant issue among users: https://www.reddit.com/r/kde/comments/1otkbex/is_anybody_else_having_this_issue_with_krunner/
Comment 1 TraceyC 2025-12-05 18:05:27 UTC
*** Bug 512350 has been marked as a duplicate of this bug. ***
Comment 2 TraceyC 2025-12-05 18:06:06 UTC
I can confirm the search result ordering on Plasma built from git-master.

This affects both krunner and Kickoff Application Launcher
Comment 3 apfelkuchen-public 2025-12-05 18:57:19 UTC
(In reply to Connor Chang from comment #0)
> When I type ala for alacritty, the results are:
> - Palapeli
> - KAlarm
> - Alacritty
> When Alacritty should really be the first, which is the behavior in plasma

As I described in 511078 this  happens for me and several others on 6.5.3 as well. In my case I wanted LACT, and typing "lac" gives me Alacritty first. Looking for "gim" will bring up vim, qimgv, libre office impress, divinity original sin, and only then gimp. Looking for "gnu" does bring it up first, but I doubt most people looking for gimp would use that search term. 
I also get btrfs-assistant before btop with a "bt", which is admittedly a lot closer, but still not as expected.
Comment 4 Bug Janitor Service 2025-12-16 17:12:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6104
Comment 5 Harald Sitter 2025-12-16 21:42:20 UTC
Git commit 1e064d14205a18f85479947f31394a3ce16946c6 by Harald Sitter.
Committed on 16/12/2025 at 19:34.
Pushed by sitter into branch 'master'.

servicerunner: when a key starts with the search term, bump it

this leads to better results when fuzzy matches are only slightly
different but one item has the startswith advantage

A  +19   -0    runners/services/autotests/fixtures/Alacritty.desktop
A  +12   -0    runners/services/autotests/fixtures/org.kde.palapeli.desktop
M  +15   -1    runners/services/autotests/servicerunnertest.cpp
M  +16   -1    runners/services/servicerunner.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/1e064d14205a18f85479947f31394a3ce16946c6
Comment 6 Harald Sitter 2025-12-16 23:35:16 UTC
Git commit b762202c8cb41d4c86b4838a4a3e6273da8d3989 by Harald Sitter.
Committed on 16/12/2025 at 21:50.
Pushed by sitter into branch 'Plasma/6.5'.

servicerunner: when a key starts with the search term, bump it

this leads to better results when fuzzy matches are only slightly
different but one item has the startswith advantage


(cherry picked from commit 1e064d14205a18f85479947f31394a3ce16946c6)

Co-authored-by: Harald Sitter <sitter@kde.org>

A  +19   -0    runners/services/autotests/fixtures/Alacritty.desktop
A  +12   -0    runners/services/autotests/fixtures/org.kde.palapeli.desktop
M  +15   -1    runners/services/autotests/servicerunnertest.cpp
M  +16   -1    runners/services/servicerunner.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/b762202c8cb41d4c86b4838a4a3e6273da8d3989