Bug 474782 - Recent files search is case sensitive
Summary: Recent files search is case sensitive
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.5
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-22 06:55 UTC by Michael D
Modified: 2024-10-30 02:48 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.9
Sentry Crash Report:


Attachments
Recent documents runner does find query anywhere in file name (28.94 KB, image/png)
2023-09-22 15:21 UTC, Natalie Clarius
Details
It's case insensitive (109.27 KB, image/png)
2023-09-22 20:35 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael D 2023-09-22 06:55:57 UTC
The search algorithm for recent files is not very "smart" and requires knowing the beginning of the filename. E.g. if the file is called "Carroll and the tortoise.pdf", searching any substring that does not include the initial segment will fail to return anything, e.g. searching "tortoise" will not return anything but "carr" will.
Comment 1 Natalie Clarius 2023-09-22 15:21:09 UTC
Created attachment 161805 [details]
Recent documents runner does find query anywhere in file name

Can't reproduce:
Comment 2 Natalie Clarius 2023-09-22 15:45:13 UTC
And looking at the code I don't see what could cause this.
Comment 3 Alexander Lohnau 2023-09-22 15:53:37 UTC
Michael, could you please post a screenshot of the issue?
Comment 4 Michael D 2023-09-22 17:42:28 UTC
Sorry, the problem is not what I thought it was. The problem is that search is case sensitive. If the file is called "Carroll and the Tortoise.pdf" and I search "tortoise", it won't return a result, but I will if I type "Tortoise". I think this is a bug in any case as a search for recent files shouldn't be case sensitive.
Comment 5 Alexander Lohnau 2023-09-22 19:38:17 UTC
Oh well, you are right. Looking at the API, it does not offer a case sensitivity option :/

This will need a bit of work/thinking. Most likely it will target Plasma 6.
Comment 6 Nate Graham 2023-09-22 20:35:23 UTC
Created attachment 161811 [details]
It's case insensitive

Can't reproduce that either; here's a screenshot of a Recent Files match that's case insensitive.
Comment 7 Michael D 2023-09-22 21:28:34 UTC
(In reply to Nate Graham from comment #6)
> Created attachment 161811 [details]
> It's case insensitive
> 
> Can't reproduce that either; here's a screenshot of a Recent Files match
> that's case insensitive.

It's insensitive after the first character, which I forgot to mention...
Comment 8 Alexander Lohnau 2023-09-25 05:41:06 UTC
That is perfect analysis! While optimizing some code, I noticed the condition that we run into. I'll make a MR shortly to make a backportable fix.
Comment 9 Michael D 2023-09-25 05:47:41 UTC
Awesome, thanks!
Comment 10 Bug Janitor Service 2023-09-25 12:51:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3332
Comment 11 Alexander Lohnau 2023-09-25 14:57:24 UTC
Git commit 28ced0e1e0bc5f62f107b3e6871fda60277297e8 by Alexander Lohnau.
Committed on 25/09/2023 at 14:52.
Pushed by alex into branch 'master'.

runners/recentdocuments: Fix results being discarded when casing is different
Regression from ecfc27c245a84085127982b43af92b8148740922

Test Plan:
- Create a file called MyTextFile.txt
- Open it in any KDE app so it is in the recent files list
- "MyTextFile" should work as before and provide the result
- "textfile" as a query should only provide a result with this change

M  +1    -1    runners/recentdocuments/recentdocuments.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/28ced0e1e0bc5f62f107b3e6871fda60277297e8
Comment 12 Alexander Lohnau 2023-09-25 17:35:00 UTC
Git commit 0a22f4635dc8739e31b93e9633d287d06dd6ae8a by Alexander Lohnau.
Committed on 25/09/2023 at 19:33.
Pushed by alex into branch 'Plasma/5.27'.

runners/recentdocuments: Fix results being discarded when casing is different
FIXED-IN: 5.27.9
Regression from ecfc27c245a84085127982b43af92b8148740922

Test Plan:
- Create a file called MyTextFile.txt
- Open it in any KDE app so it is in the recent files list
- "MyTextFile" should work as before and provide the result
- "textfile" as a query should only provide a result with this change

Cherry-picked from 28ced0e1e0bc5f62f107b3e6871fda60277297e8

M  +1    -1    runners/recentdocuments/recentdocuments.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/0a22f4635dc8739e31b93e9633d287d06dd6ae8a
Comment 13 Alexander Lohnau 2023-09-25 17:36:29 UTC
I couldn't cherry-pick in GitLab directly and resolved the conflict locally. Hence the slight delay and adjustment of FIXED-IN version ;)
Comment 14 Gerson 2024-10-30 02:48:25 UTC
This bug is marked as fixed, but I'm seeing it on Manjaro running Plasma 6.1.5. The file search is fully case-sensitive on krunner, but on the terminal baloosearch works as expected.