Bug 469769

Summary: Non-ideal results with two-character search for "te"
Product: [Plasma] krunner Reporter: popov895 <popov895>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.lohnau, mikel5764, natalie_clarius, nate, noahadvs, popov895, seyfetdinovaa
Priority: NOR    
Version: 5.27.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=470022
Latest Commit: Version Fixed In: 5.27.6
Sentry Crash Report:
Attachments: Inaccurate search
Search in KRunner

Description popov895 2023-05-14 21:55:09 UTC
Created attachment 158951 [details]
Inaccurate search

SUMMARY

Search results may contain irrelevant items, which may also appear prior to relevant ones.

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20230512
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Kernel Version: 6.3.1-2-default (64-bit)
Graphics Platform: X11
Comment 1 Nate Graham 2023-05-15 17:53:37 UTC
Is the same issue seen in KRunner? Or just in Kickoff?
Comment 2 popov895 2023-05-15 18:31:57 UTC
Created attachment 158976 [details]
Search in KRunner

Same in KRunner.
Comment 3 Nate Graham 2023-05-16 13:30:10 UTC
Thanks. Two questions:
1. What would you expect to see under Telegram when you search for "te"?
2. If you add another letter to make it "tel", do the search results become more relevant?
Comment 4 Alexander Lohnau 2023-05-16 13:56:56 UTC
I understand why it is a problem, but am not sure what the cause is. My first guess was the exec values, but https://invent.kde.org/plasma/plasma-workspace/-/commit/820c5b1a27c2b534f679e09de5b2b68378ad9f72 should be a part of Plasma 5.27.

Can you maybe attach the desktop file of ark? That should be /usr/share/applications/org.kde.ark.desktop. Locally, I do not get such irrelevant results (with having the same apps installed that show up for you)
Comment 5 popov895 2023-05-16 15:29:59 UTC
I wonder if the search is provided throughout all the desktop entry keys. If so, then the following part of the Ark's desktop file could be the cause:

> Categories=Qt;KDE;Utility;Archiving;X-KDE-Utilities-File;System;

Also, search results for "tim" include VLC, while its name ("VLC media player") and description ("Media player") don't contain this phrase. The following part of its desktop file could be the cause:

> Comment=Read, capture, broadcast your multimedia streams
Comment 6 Alexander Lohnau 2023-05-16 16:35:29 UTC
Interesting, my desktop file looks different. But I can confirm the issue now.
Comment 7 popov895 2023-05-17 22:26:46 UTC
Can we add some configuration UI so that the user can select the desktop entry keys that should be used when searching for apps?
Comment 8 Bug Janitor Service 2023-05-18 14:03:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2933
Comment 9 Alexander Lohnau 2023-05-18 15:41:32 UTC
I am not sure if this feature is needed once this bug is resolved
Comment 10 popov895 2023-05-18 19:22:55 UTC
What about `Comment`?

I'd still prefer to have configuration UI.
Comment 11 Alexander Lohnau 2023-05-19 06:44:38 UTC
Not sure TBH, maybe make a separate feature request for it?
Comment 12 popov895 2023-05-19 21:40:07 UTC
(In reply to Alexander Lohnau from comment #11)
> Not sure TBH, maybe make a separate feature request for it?

Bug 470022
Comment 13 Alexander Lohnau 2023-05-24 14:59:41 UTC
Git commit bd9b4723d2478a43e3e0a4ef874848c7afa0d5f5 by Alexander Lohnau.
Committed on 24/05/2023 at 14:40.
Pushed by alex into branch 'master'.

runners/services: Do not match categories for short queries

Otherwise, one can get unexpected results for substring-matches.
Apart from the matches not being relevant, this is confusing, because the category is not visible to the user

M  +1    -1    runners/services/autotests/fixtures/org.kde.yakuake.desktop
M  +6    -0    runners/services/autotests/servicerunnertest.cpp
M  +4    -0    runners/services/servicerunner.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/bd9b4723d2478a43e3e0a4ef874848c7afa0d5f5
Comment 14 Alexander Lohnau 2023-05-24 15:30:51 UTC
Git commit fc675e7f4690d690e46ef6d8ef4dc47dbe56d643 by Alexander Lohnau.
Committed on 24/05/2023 at 15:30.
Pushed by alex into branch 'Plasma/5.27'.

runners/services: Do not match categories for short queries

Otherwise, one can get unexpected results for substring-matches.
Apart from the matches not being relevant, this is confusing, because the category is not visible to the user


(cherry picked from commit bd9b4723d2478a43e3e0a4ef874848c7afa0d5f5)

M  +1    -1    runners/services/autotests/fixtures/org.kde.yakuake.desktop
M  +6    -0    runners/services/autotests/servicerunnertest.cpp
M  +4    -0    runners/services/servicerunner.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/fc675e7f4690d690e46ef6d8ef4dc47dbe56d643
Comment 15 Alexander Lohnau 2023-05-25 11:42:32 UTC
*** Bug 470250 has been marked as a duplicate of this bug. ***
Comment 16 popov895 2023-05-28 21:19:06 UTC
I also found that an app whose name starts with the search query will rank lower in search results than an app whose name only contains the search query if the second one has been launched more times than the first one. Is it a bug or feature?
Comment 17 Alexander Lohnau 2023-05-29 15:15:15 UTC
It is a feature, but I am considering on improving it in for KF6. Though it is a lower priority than other search related bugs/feature requests.