Bug 441068 - Dolphin is unable to search file names n unidexed directories
Summary: Dolphin is unable to search file names n unidexed directories
Status: ASSIGNED
Alias: None
Product: dolphin
Classification: Applications
Component: search (show other bugs)
Version: 21.04.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-17 06:15 UTC by firewalker
Modified: 2023-10-27 18:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
First (217.32 KB, image/png)
2022-01-10 09:12 UTC, Nathan Colinet
Details
Second (116.43 KB, image/png)
2022-01-10 09:21 UTC, Nathan Colinet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description firewalker 2021-08-17 06:15:45 UTC
For many years now, dolphin is unable to search for files in directories that is not indexed be baloo. This is a major drawback for removable storage search. The user should have a quickly accessible switch to use or not the index.


Search for any file to any unindexed directory.

OBSERVED RESULT
No match is returned.

EXPECTED RESULT
The files managers should be able to find files that exist in a directory tree.

Operating System: Arch Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Kernel Version: 5.13.10-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 PRO 4650U with Radeon Graphics
Memory: 14,9 GiB of RAM
Graphics Processor: AMD RENOIR
Comment 1 Nathan Colinet 2022-01-09 13:46:09 UTC
Still there, the end user expects such a feature to actually work. No error reported, nothing. Very frustrating.
Comment 2 tagwerk19 2022-01-10 06:20:43 UTC
(In reply to Nathan Colinet from comment #1)
> Still there, the end user expects such a feature to actually work. No error
> reported, nothing. Very frustrating.
I'm missing a few steps along the way :-)

If I'm in Neon and plug in a USB (you are talking about removable media), the USB appears under
        /media/myusername/myusb
or similar. This won't be indexed by baloo and if you search dolphin will give you a prompt like:
        https://bugsfiles.kde.org/attachment.cgi?id=137170
By contrast if baloo has indexed (has been told to index) the folders, dolphin "knows" this and will give a prompt with more options:
        https://bugsfiles.kde.org/attachment.cgi?id=137169

If you go to
        /media/myusername/myusb
and do a Ctrl-F to search, dolphin will search "there and then" through the subfolders and present the results. It's doing the scanning "there and then" so it's slower and you might have to wait for the results to be presented. Dolphin relies on a process "filenamesearch" to do this work.

In order to see the results, you *will* need to select the "Filename", rather than "Content", option and "From Here (myusb)" rather than "Your Files".

I can say, in Neon, the above "magic" works but let's look one step at a time...
Comment 3 Nathan Colinet 2022-01-10 09:12:56 UTC
Created attachment 145289 [details]
First
Comment 4 Nathan Colinet 2022-01-10 09:14:52 UTC
Comment on attachment 145289 [details]
First

Yes that's how it is supposed to work. But some folder just can't search (even some indexed ones). The search "from here" returns nothing.
Comment 5 Nathan Colinet 2022-01-10 09:21:34 UTC
Created attachment 145290 [details]
Second

Sorry I messed up the comments section. Any way to add multiple attachments ? How to delete comments?

So when I search in a folder (randomly chosen, indexed or not) sometimes the search "from here" doesn't yeld any result.

See the "first" screen shot in my previous comments , here are the second one. So In those screenshot I show the content of a folder without doing any search, then if I search for anything (that exists) it won't display a thing.
Comment 6 tagwerk19 2022-01-10 11:40:05 UTC
(In reply to Nathan Colinet from comment #5)
> Sorry I messed up the comments section. Any way to add multiple attachments
> ? How to delete comments?
Don't worry, happens to everyone 8-)
 
> ... here are the second
> one. So In those screenshot I show the content of a folder without doing any
> search, then if I search for anything (that exists) it won't display a thing ...
If I look at this search, you are in your Downloads folder and searching from there. The search box is giving you the "extra options", the "type", "date", "rating" and "tags", that says dolphin thinks that baloo has indexed the folder.

Can be that this is where things are going wrong, dolphin thinks that baloo has indexed the folder and it will ask baloo to give the results. You can have a look with a command line:
    baloosearch pdf
to see if baloo can find the pdf files.

What might be happening is you have a symlink from your home directory to an "external" disc that is holding your downloads. That will mess up baloo as it doesn't follow symlinks when indexing. There's a summary of this issue in Bug 447119, Case 3
Comment 7 Nathan Colinet 2022-01-10 15:21:22 UTC
> If I look at this search, you are in your Downloads folder and searching
> from there. The search box is giving you the "extra options", the "type",
> "date", "rating" and "tags", that says dolphin thinks that baloo has indexed
> the folder.
> 
> Can be that this is where things are going wrong, dolphin thinks that baloo
> has indexed the folder and it will ask baloo to give the results. You can
> have a look with a command line:
>     baloosearch pdf
> to see if baloo can find the pdf files.

Yes, baloo can find them. If I mark this folder as not indexed in baloo kcm, the search from here works.

> What might be happening is you have a symlink from your home directory to an
> "external" disc that is holding your downloads. That will mess up baloo as
> it doesn't follow symlinks when indexing. There's a summary of this issue in
> Bug 447119, Case 3

I use systemd-homed, maybe it is related.
Comment 8 Nathan Colinet 2022-01-10 15:31:08 UTC
I disabled then re enabled indexing of the home directory. It looks like it works for now. Thank you for the help.
Comment 9 tagwerk19 2022-01-10 21:10:56 UTC
(In reply to Nathan Colinet from comment #7)
> I use systemd-homed, maybe it is related.
Certainly worthy of note.

Don't have experience with systemd-homed but if files appear with different device/inode numbers every time you logged on, it would confuse things.

You can check with the "stat" command, try
    stat oneofyourfiles
and look at the Device/Inode line. If you reboot and these values change, then baloo is going to have trouble.
Comment 10 firewalker 2022-01-10 21:32:28 UTC
As I understand many of the problems in Dolphin find is due to Baloo. For example baloo cant handle "*" wild character, it corrupt the index etc.
Comment 11 tagwerk19 2022-01-11 11:52:34 UTC
(In reply to firewalker from comment #10)
>  ... baloo cant handle "*" wild characte
For wildcard searches, I think you're looking for something like plocate

You get globs or regexp's but won't get dolphin refining search results as you type. I don't think there's a way of watching for changes in the filesystem (with inotify) and updating the index; you are dependent on a scheduled job. Blazingly fast though for filename searches. 

> ... it corrupt the index etc.
That certainly was a problem, Bug 389848 as evidence :-/ It's far better nowadays...

(In reply to firewalker from comment #0)
> For many years now, dolphin is unable to search for files in directories
> that is not indexed be baloo. This is a major drawback for removable storage
> search.
> Search for any file to any unindexed directory.
Did this get sorted? Does it look like anything in Bug 447119?
Comment 12 Nathan Colinet 2022-01-11 17:10:39 UTC
> Don't have experience with systemd-homed but if files appear with different
> device/inode numbers every time you logged on, it would confuse things.
> 
> You can check with the "stat" command, try
>     stat oneofyourfiles
> and look at the Device/Inode line. If you reboot and these values change,
> then baloo is going to have trouble.

Same inode after reboot, the search is still working.
Comment 13 Bug Janitor Service 2023-10-27 18:56:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/642