Bug 439438 - Dolphin's search does not work (baloo enabled) when inside a linked folder
Summary: Dolphin's search does not work (baloo enabled) when inside a linked folder
Status: RESOLVED DUPLICATE of bug 447119
Alias: None
Product: dolphin
Classification: Applications
Component: search (show other bugs)
Version: 21.04.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-03 12:00 UTC by dagobertram
Modified: 2021-12-18 09:05 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Dolphin "baloo" search dialog (41.19 KB, image/png)
2021-07-04 10:18 UTC, tagwerk19
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dagobertram 2021-07-03 12:00:41 UTC
SUMMARY
I tend to replace the standard folders in my home directory with links to folders on other HDD's, such as Documents, Videos, Music and Pictures. I just found out that baloo searches inside dolphin do not work, while being in the linked folder.

Example:
The linked folder /home/<user>/Music links to a folder on a different HDD: /media/<user>/HDD1/Music.
When I search for "interpret" inside of /home/<user>/Music it does neither return /home/<user>/Music/Interpret nor /media/<user>/HDD1/Music/Interpret. ("baloosearch interpret" returns both, though, as does searching inside of /home/<user>.)
When I search for "interpret" inside of /media/<user>/HDD1 it returns /media/<user>/HDD1/Music/Interpret as expected.

STEPS TO REPRODUCE
1. replace the Music folder in your home directory with a link named "Music" which links to a folder on another HDD
2. start search in Dolphin with CTRL+F and search for music in your home directory
3. search for music after following the link to your "Music" by clicking on it

OBSERVED RESULT
2. returns search results
3. does not

EXPECTED RESULT
Works in both cases

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.3
Graphics Platform: X11
Comment 1 tagwerk19 2021-07-04 10:18:38 UTC
Created attachment 139839 [details]
Dolphin "baloo" search dialog

Dolphin showing the "baloo" search dialog (although baloo has not indexed ~/Pictures)
Comment 2 tagwerk19 2021-07-04 10:29:24 UTC
(In reply to dagobertram from comment #0)
> 1. replace the Music folder in your home directory with a link named "Music"
> which links to a folder on another HDD
> 2. start search in Dolphin with CTRL+F and search for music in your home
> directory
> 3. search for music after following the link to your "Music" by clicking on
> it
Ah, ah....

I set up a second disc, added it to /etc/fstab and created a symlink from ~/Pictures to /mnt/disc2/Pictures. Sounds the same setup as yours...

Baloo does not follow symbolic links so it does not "naturally" pick up up anything added to the second disc. I created a test file and it was not indexed.

However I see that if I go to Dolphin, move down to the Pictures folder and Ctrl-F for a search, I get the search dialog appropriate for a baloo search and no matches (cf attachment). That's not right.

Dolphin double guesses what baloo is indexing but "real life" is more complicated.

However, I find that if I add ~/Pictures to baloo's "include list", it seems to work.
    folders[$e]=$HOME/,$HOME/Pictures/
Baloo seems to index the content and it presents the results "under" ~/Pictures.

Maybe this is based on "shifting sands" in that baloo relies on a one-to-one match between its internal ID (the device number and inode) and the pathname - and with symbolic links you are creating a potential one-to-many relationships. Could be this leads to further weird, exotic and confusing behaviours 8-]
Comment 3 tagwerk19 2021-07-04 11:54:46 UTC
(In reply to dagobertram from comment #0)
> The linked folder /home/<user>/Music links to a folder on a different HDD:
> /media/<user>/HDD1/Music.
> When I search for "interpret" inside of /home/<user>/Music it does neither
> return /home/<user>/Music/Interpret nor /media/<user>/HDD1/Music/Interpret.
> ("baloosearch interpret" returns both, though, as does searching inside of
> /home/<user>.)
> When I search for "interpret" inside of /media/<user>/HDD1 it returns
> /media/<user>/HDD1/Music/Interpret as expected.
I think I don't see that... but there's load of different scenarios to check.

I only get the equivalent of your "baloosearch interpret" result if I have added the ~/Pictures folder to the search

If I go to the equivalent of your /media/<user>/HDD1, dolphin uses its own "filenamesearch" provider (not baloo)

Enough here though to say "Confirmed"...
Comment 4 dagobertram 2021-07-04 12:04:59 UTC
(In reply to tagwerk19 from comment #3)
> (In reply to dagobertram from comment #0)
> > The linked folder /home/<user>/Music links to a folder on a different HDD:
> > /media/<user>/HDD1/Music.
> > When I search for "interpret" inside of /home/<user>/Music it does neither
> > return /home/<user>/Music/Interpret nor /media/<user>/HDD1/Music/Interpret.
> > ("baloosearch interpret" returns both, though, as does searching inside of
> > /home/<user>.)
> > When I search for "interpret" inside of /media/<user>/HDD1 it returns
> > /media/<user>/HDD1/Music/Interpret as expected.
> I think I don't see that... but there's load of different scenarios to check.
> 
> I only get the equivalent of your "baloosearch interpret" result if I have
> added the ~/Pictures folder to the search
> 
> If I go to the equivalent of your /media/<user>/HDD1, dolphin uses its own
> "filenamesearch" provider (not baloo)
> 
> Enough here though to say "Confirmed"...

Sorry I forgot to mention, that I both indexed my home directory (including the link) as well as "/media/<user>/HDD1" (including the linked-to-folder).
Comment 5 tagwerk19 2021-07-04 15:12:58 UTC
(In reply to dagobertram from comment #0)
> When I search for "interpret" inside of /home/<user>/Music it does neither
> return /home/<user>/Music/Interpret nor /media/<user>/HDD1/Music/Interpret.
> ("baloosearch interpret" returns both, though, as does searching inside of
> /home/<user>.)
> When I search for "interpret" inside of /media/<user>/HDD1 it returns
> /media/<user>/HDD1/Music/Interpret as expected.
(... comment #4)
> Sorry I forgot to mention, that I both indexed my home directory (including
> the link) as well as "/media/<user>/HDD1" (including the linked-to-folder).
Yes. In that scenario, same for me...
Comment 6 tagwerk19 2021-12-18 09:05:04 UTC
Created a separate bug that summarises Dolphin/Baloo "symlink troubles", Bug 447119

I think the originally reported issue is described in 447119 "Case 2a";  symlinks seem to be the cause of quite a few different "confusing behaviours".

Will flag this as a duplicate. If you feel that's wrong and I've missed or misunderstood something, reopen this issue and append details.

*** This bug has been marked as a duplicate of bug 447119 ***