Bug 347718

Summary: Krunner should rank local locations over search term hits when text starts with ~/
Product: [Plasma] krunner Reporter: Rohan Garg <rohan>
Component: locationsAssignee: Sebastian Kügler <sebas>
Status: RESOLVED FIXED    
Severity: wishlist CC: alexander.lohnau, justin.zobel, nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.21
Sentry Crash Report:
Attachments: Okay, can reproduce :)

Description Rohan Garg 2015-05-14 13:17:29 UTC
I use krunner alot to open local files, such as ~/Movies , however, krunner seems to prefer files that have the term '~' in them instead of the location ~/Movies in the result index. This causes fun issues such as opening a book when I instead wanted to watch a Movie.

Would it be possible to detect when a string is a local location and rank it highest?

Reproducible: Always

Steps to Reproduce:
1. Have a file which has the term ~/Movies in it
2. Have a Location ~/Movies
3. Search for ~/Movies

Actual Results:  
The file is ranked the highest

Expected Results:  
The folder ~/Movies is ranked highest
Comment 1 Justin Zobel 2020-11-22 03:42:17 UTC
I think this would be a good change, moved to wishlist as it's not a bug.
Comment 2 Alexander Lohnau 2020-12-18 07:51:35 UTC
Can you please provide a screenshot of this issue?
Comment 3 Alexander Lohnau 2020-12-18 09:11:22 UTC
Created attachment 134172 [details]
Okay, can reproduce :)
Comment 4 Bug Janitor Service 2020-12-18 12:57:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/524
Comment 5 Alexander Lohnau 2020-12-18 21:14:54 UTC
Git commit 416c4b8f6a7cf1dac1bc31184830269045ce30c9 by Alexander Lohnau.
Committed on 18/12/2020 at 12:56.
Pushed by alex into branch 'master'.

Do not show duplicate results from location and baloo runner
FIXED-IN: 5.21

If the file path is an exact match the location runner will
display a match, we do not want to duplicate that in baloo.

M  +6    -0    runners/baloo/baloosearchrunner.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/416c4b8f6a7cf1dac1bc31184830269045ce30c9