Bug 460508 - Dolphin search crosses file system boundary when Baloo is disabled
Summary: Dolphin search crosses file system boundary when Baloo is disabled
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: search (show other bugs)
Version: 22.08.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-15 21:41 UTC by Adam Fontenot
Modified: 2022-10-17 18:44 UTC (History)
2 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 Adam Fontenot 2022-10-15 21:41:03 UTC
SUMMARY

I occasionally have remote file systems (like sshfs) mounted locally under my home directory. Baloo, sensibly enough, does not index under these directories, and Dolphin does not attempt to search them when Baloo is enabled. However, having recently been forced to disable Baloo, I discovered that Dolphin crosses file system boundaries when Baloo is disabled.


STEPS TO REPRODUCE
1. Disable Baloo
2. Mount a large remote directory via sshfs in your home directory
3. Try to search your home directory in Dolphin

OBSERVED RESULT
The search is extremely slow (assuming that the remote directory is slow and large enough). With the right search terms you can verify that some of the results are from the remote file system.

I killed a search after five minutes. Searching my 500k file home directory with `find -xdev` takes 5 seconds, even after dropping caches. 

EXPECTED RESULT
Dolphin should mirror the behavior of Baloo and not cross file system boundaries when searching by default.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 6.0.1-arch1-1 (64-bit)
Graphics Platform: X11
Comment 1 tagwerk19 2022-10-16 06:58:20 UTC
I think if you are searching with Dolphin, and Dolphin sees that baloo is disabled or the folder "it is in" is not indexed by baloo, it will start a "there and then" search. That is via "filenamesearch" rather then "baloosearch" (although it's a bit more difficult to see what Dolphin is doing behind the scenes nowadays).

A "filenamesearch", despite the name, can also search content if you've requested it. Doing this over a remote connection is likely to be quite slow...

The "there and then" search does things like follow symlinks (that baloo avoids doing), I would need to check behaviours with mounts "under" $HOME

Tangentially... Dolphin/Baloo search with symlinks: Bug 447119
Comment 2 Adam Fontenot 2022-10-16 07:07:42 UTC
(In reply to tagwerk19 from comment #1)
> I think if you are searching with Dolphin, and Dolphin sees that baloo is
> disabled or the folder "it is in" is not indexed by baloo, it will start a
> "there and then" search. That is via "filenamesearch" rather then
> "baloosearch" (although it's a bit more difficult to see what Dolphin is
> doing behind the scenes nowadays).

Just to make sure it's clear - I'm not searching inside a mounted remote directory. I'm searching inside a directory (my home folder) that contains a mounted remote directory. If Dolphin is currently browsing inside the remote, I expect it to search the remote (because the search "starts in" the remote file system). When searching my home directory, I expect it to skip other filesystems.
Comment 3 tagwerk19 2022-10-16 20:06:52 UTC
(In reply to tagwerk19 from comment #1)
> ... I would need to check behaviours with mounts "under" $HOME ...
Looks like, If you've an sshfs mount in your home directory:

    Baloo will index it ...
    Dolphin's recursive search with delve down into it ...

Every day a learning day!

Don't have a feeling for what "people would expect to happen" here but flagging "Confirmed"
Comment 4 tagwerk19 2022-10-17 18:44:34 UTC
(In reply to tagwerk19 from comment #3)
> Looks like, If you've an sshfs mount in your home directory:
> 
>     Baloo will index it ...
This is somehow runs counter to a fix, long, long ago...
    https://bugs.kde.org/show_bug.cgi?id=333433#c3