Bug 388857 - Krunner can't actually search for files
Summary: Krunner can't actually search for files
Status: CONFIRMED
Alias: None
Product: krunner
Classification: Plasma
Component: filesearch (show other bugs)
Version: 5.11.5
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
: 420129 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-01-12 12:03 UTC by T R T
Modified: 2022-02-23 22:51 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description T R T 2018-01-12 12:03:27 UTC
Hi,

Krunner can't search for files - it can only search for what is in the program launcher's history(and what was read by KDE apps). It's possible that it only caches the content of xdg directories. Same true for general actions and programs - if it was never started by a launcher it won't show up. I think krunner uses a poor indexing mechanism instead of actually doing what we expect from it.
Comment 1 Nate Graham 2018-01-12 15:08:40 UTC
Search is provided by Baloo; KRunner is just a user. Can you check the following?

- Run `baloosearch <name of file>` on the command line; and does it show you any files?
- Run `balooshow <path/to/some/file/in/your/home/directory>` on the command line; and does it show you any files?
Comment 2 T R T 2018-01-12 15:32:59 UTC
`baloosearch <name of file|keyword>` works fine.
Comment 3 Nate Graham 2018-01-12 15:45:19 UTC
Thanks. Can you check to see if KRunner is set up to search for files?

System Settings > Search > Plasma Search > [Desktop search should be checked].
Comment 4 T R T 2018-01-12 15:48:42 UTC
Yes, the checkbox is on.
Comment 5 Nate Graham 2018-01-12 16:10:47 UTC
Thanks for debugging! I see from https://bugs.kde.org/show_bug.cgi?id=388856 that various other things with KRunner aren't working as they should. I'm beginning to suspect a configuration or distro packaging issue, since I'm using all the same versions and everything works for me. I would suggest at this point to start a thread on the Manjaro forums (https://forum.manjaro.org/) and see if you can get some help there. If that yields an actionable bug on our side, we'll be happy to take a look!
Comment 6 Nate Graham 2020-04-15 18:14:43 UTC
*** Bug 420129 has been marked as a duplicate of this bug. ***
Comment 7 tagwerk19 2020-04-16 16:09:08 UTC
Post in askubuntu:

https://askubuntu.com/questions/1227401/krunner-doesnt-find-some-files
Comment 9 tagwerk19 2020-04-17 06:10:36 UTC
And discussion here:

    https://old.reddit.com/r/kde/comments/g27ab8/some_files_found_with_baloosearch_but_not_with/

I wasn't able to install qdbus-qt5 (under Neon) but could use dbus-send

    dbus-send --print-reply --dest=org.kde.runners.baloo /runner org.kde.krunner1.Match string:'test pdf'
Comment 10 Masacroso 2020-04-19 07:32:14 UTC
I solved the issue deleting the index file of baloo and forcing it to re-index everything.
Comment 11 Knut Hildebrandt 2021-03-18 14:38:35 UTC
Got a similar problem and Masacroso trick did not work. But let me describe the behavior.

When I start entering the search term krunner offers finds in different categories. Some of these do not even contain the yet entered sequence, for instance "rechnung" also brings up "Buchhaltung" in the category "Tabellenkalkulation", which I suppose is spreadsheet in an english environment. This seems odd, since I assumed that filenames are searched for. When I continue entering parts of the filename at a certain point results disappear except an entry under browser history and an empty entry under "Tabellenkalkulation". It is like this for "rechnung2" and "rechnung20", for "rechnung201" the empty category changes to "Dokument", which is empty too. When I enter more parts of the filename the following happens:

"rechnung2015" -> some, but not all, of the documents I was looking for are shown "rechnung2015-" -> no change
"rechnung2015-0" -> all search result, except the browser history, disappear
"rechnung2015-09" -> the file searched for appears among others
"rechnung2015-09-" -> no change
"rechnung2015-09-0" -> all search result, except the browser history, disappear
"rechnung2015-09-01" -> the file searched for reappears

I see there a pattern, every time when there is a hyphen the next entry causes the search results to disappear. BTW, this happens in dolphin as well, when I use Ctrl-F to search. But the behavior seen in krunner between "rechnung2" and "rechnung201" can't be observed in dolphin.

There is another strange example, this time slightly different. I search for "Onda-Info-2021.ods", which never is shown in krunner. In dolphin it is show until the first character after a hyphen is entered. Then it disappears. This time results are only shown again after entering three more characters.
Comment 12 Knut Hildebrandt 2021-03-18 15:12:10 UTC
(In reply to Knut Hildebrandt from comment #11)
> I see there a pattern, every time when there is a hyphen the next entry ...

I think it should be dash instead of hyphen, since it is the character which shares a key with the underscore
Comment 13 Knut Hildebrandt 2021-03-19 23:18:32 UTC
The problem seems to be solved, even though the underlying problem in baloo still exists. Since yesterday at least all documents I'm searching for appear in the search results. There're still some I would not expect but they are thematically related and probably contain the search string. And the strange behavior when there are dashes in the search string also still exists, but now krunner behaves like the dolphin search and baloosearch.

Last night a update came in. I'm now on:
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Comment 14 sourcemaker 2021-11-03 22:59:22 UTC
Same issue on ArchLinux - baloo 5.87.0.
Comment 15 tagwerk19 2021-11-04 08:35:44 UTC
(In reply to sourcemaker from comment #14)
> Same issue on ArchLinux - baloo 5.87.0.
Are you referring to the original issue in this thread?

In which case the baloosearch/balooshow troubleshooting steps of comment #1 and 3 makes sense.

Or are you seeing the same behaviour as comment #11? Which I think "is still a thing"
Comment 16 sourcemaker 2021-11-04 09:45:35 UTC
baloosearch StringUtils 
=> 2 results

KRunner StringUtils 
=> 0 results
Comment 17 sourcemaker 2021-11-04 09:46:45 UTC
All KRunner plugins are enabled.
Comment 18 tagwerk19 2021-11-04 16:25:38 UTC
(In reply to sourcemaker from comment #16)
> baloosearch StringUtils 
> => 2 results
> 
> KRunner StringUtils 
> => 0 results
Some shifting sands here...

I can create a text file "StringUtils" and baloosearch and krunner both see it. Tried on:

    Neon User
    Plasma: 5.23.2
    Frameworks: 5.87.0
    Qt: 5.15.3

and

    Fedora 35
    Plasma: 5.22.5
    Frameworks: 5.85.0
    Qt: 5.15.2

However on:

    Neon Unstable
    Plasma: 5.23.80
    Frameworks: 5.88.0
    Qt: 5.15.3

I get a different behaviour:

    If I create a textfile "StringUtils", baloosearch sees it and krunner doesn't
    If I create "stringutils", both baloosearch and krunner see it
    If I create "StringUtils.txt", both baloosearch and krunner see it.

I don't know if this is real/reproducible or an artifact of my systems
Comment 19 sourcemaker 2021-11-04 16:59:54 UTC
ArchLinux
Plasma: 5.23.2
Frameworks: 5.87.0
Qt: 5.15.2

Searching for:

git.txt - ok
Git.txt - broken
git.sh - broken
Comment 20 sourcemaker 2021-11-04 17:03:23 UTC
StringUtils - broken
stringutils - broken
StringUtils.txt - ok
Comment 21 tagwerk19 2021-11-05 07:45:31 UTC
Checked on Tumbleweed and cannot replicate my results. Tests that failed before seem OK now.

There definitely caching involved, "pkill baloorunner" seems necessary between tests (but whether there's more, dunno). Occasionally baloo doesn't pick up that a test file has been deleted and need to do a "balooctl purge" to cleanly reindex
Comment 22 sourcemaker 2021-11-06 12:52:06 UTC
I purged the baloo database and did a complete re-indexing. 
Same results. 

Files are not found.
Comment 23 Masacroso 2021-11-23 14:22:34 UTC
I need to add to this discussion is that the bug with krunner doesn't showing existing files (but baloo working well) happens regularly. Every some months I need to purge the baloo file, reboot, and restart baloo service again, then after a while krunner find anything. Im using kubuntu 21.10, but this happens to me from 20.04 at least. It seems that krunner doesn't call ballo search if not it have in own search, soudns strange but I dont have a better explain about why this happen.

Also krunner tend to show old files already deleted some time ago (however baloo works well, it doesn't show inexistent files).
Comment 24 tagwerk19 2021-12-03 09:06:16 UTC
In an attempt to get something reproducible here, looked at a set of neon-testing images.

The test sequence was, on new installs of various images:

    echo "Hello Penguin" > StringUtils
    baloosearch StringUtils
    krunner StringUtils
    baloosearch Penguin
    krunner Penguin
    rm StringUtils ; balooctl purge; pkill baloorunner

    echo "Hello Penguin" > stringutils
    baloosearch stringutils
    krunner stringutils
    baloosearch Penguin
    krunner Penguin
    rm stringutils ; balooctl purge; pkill baloorunner

    echo "Hello Penguin" > StringUtils.txt
    baloosearch StringUtils.txt
    krunner StringUtils.txt
    baloosearch Penguin
    krunner Penguin

The results were, for recent images (neon-testing-20210928, 20211026, 20211130), that the baloosearch and krunner worked "as they should".

For an earlier image, neon-testing-20210831, baloosearch worked but krunner failed for *filename* searches for complete filenames

    krunner StringUtils : Failed
    krunner Penguin : Worked

    krunner stringutils : Failed
    krunner Penguin : Worked

    krunner StringUtils.txt : Failed
    krunner Penguin : Worked

If, however, you search for truncated names (that is, create a "StringUtils.txt" and try "krunner StringUtils"), krunner worked.

When upgrading neon-testing-20210831 to "current", krunner failures went away. The 20210831 image contained:

    Operating System: KDE neon Testing Edition
    KDE Plasma Version: 5.22.5
    KDE Frameworks Version: 5.86.0
    Qt Version: 5.15.3
    Kernel Version: 5.11.0-27-generic (64-bit)

And working since:

    Operating System: KDE neon Testing Edition
    KDE Plasma Version: 5.23.2
    KDE Frameworks Version: 5.88.0
    Qt Version: 5.15.3
    Kernel Version: 5.11.0-38-generic (64-bit)

I think it's worth flagging "Confirmed" on account of the older images, with a note that the issue seems not to appear on newer versions.
Comment 25 j.gjorgji 2022-02-23 22:51:06 UTC
I have the same problem, baloosearch returns corrects results however krunner does not return any results.

I've tried:
- disabling baloo, deleting the index and re-enabling it
- deleting the krunner configuration

Interestingly enough this way to search works:
qdbus-qt5 --literal org.kde.runners.baloo /runner org.kde.krunner1.Match "test"

My search settings are to enable desktop search and index file content. I have the following inclusions/exclusions:
- /home/user - not indexed
- /home/user/Downloads - indexed
- /home/user/Nextcloud - indexed

Package versions:
kf5-baloo-libs-5.90.0-1.fc35.x86_64
kf5-baloo-5.90.0-1.fc35.x86_64
kf5-baloo-file-5.90.0-1.fc35.x86_64
baloo-widgets-21.12.2-1.fc35.x86_64
kf5-krunner-5.90.0-1.fc35.x86_64