Bug 431187

Summary: Search doesn't work with |
Product: [Frameworks and Libraries] frameworks-baloo Reporter: Bill Sideris <bill88t>
Component: generalAssignee: Stefan Brüns <stefan.bruens>
Status: CONFIRMED ---    
Severity: normal CC: kfm-devel, nate, tagwerk19
Priority: NOR    
Version: 5.68.0   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Proof

Description Bill Sideris 2021-01-05 16:37:00 UTC
SUMMARY
Search does not search for the character |
I have a folder on ext4 which contains plenty of files with the character | in the name.
After I search "|" (without the "") I get nothing. No results. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: kubuntu 20.04
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Comment 1 Nate Graham 2021-01-05 17:40:55 UTC
Does it work if you use the command-line baloosearch utility?
Comment 2 Bill Sideris 2021-01-05 18:19:20 UTC
nope.
I made
/home/bill88t/Desktop/temp/all/
and
/home/bill88t/Desktop/temp/one|/

Then from the terminal:

bill88t@KeyFalse:~/Desktop$ baloosearch -d /home/bill88t/Desktop/temp -t folder "all"
/home/bill88t/Desktop/temp/all
Elapsed: 0,408531 msecs
bill88t@KeyFalse:~/Desktop$ baloosearch -d /home/bill88t/Desktop/temp -t folder "one|"
Elapsed: 0,173076 msecs
Comment 3 Nate Graham 2021-01-05 18:27:09 UTC
Seems like a bug in Baloo itself then. Can confirm. Probably | is a reserved internal character for "or" searches and it isn't escaped in user input
Comment 4 Stefan Brüns 2021-01-05 18:59:48 UTC
Can't confirm:

$> baloosearch -t folder -d  ~/Documents/Baloo/other/ "one|"
/home/stefan/Documents/Baloo/other/one|

$> balooshow -x ~/Documents/Baloo/other/*\|
463327173378375171 65027 107876764 /home/stefan/Documents/Baloo/other/one|
        Mtime: 1609872927 2021-01-05T19:55:27
        Ctime: 1609872927 2021-01-05T19:55:27

Internal Info
Terms: Mdirectory Minode T9 
File Name Terms: Fone F| 
XAttr Terms: 
49938624132742659 65027 11627242 /home/stefan/Documents/Baloo/other/with_pipe|
        Mtime: 1609872356 2021-01-05T19:45:56
        Ctime: 1609872356 2021-01-05T19:45:56

Internal Info
Terms: Mdirectory Minode T9 
File Name Terms: Fpipe Fwith F| 
XAttr Terms:
Comment 5 Bill Sideris 2021-01-05 20:41:25 UTC
Created attachment 134589 [details]
Proof

More weirdness upon close inspection..
Comment 6 Bill Sideris 2021-01-05 20:43:57 UTC
A screenshot with proof and some more weirdness.
Comment 7 Bill Sideris 2021-01-06 06:48:19 UTC
I have Baloo version 5.68.0. The thread was auto set to 5.77.0.
It was installed from the kubuntu default repos.
Comment 8 tagwerk19 2024-07-02 17:46:24 UTC
 I also don't see this happening (Neon User edition)

    test@neon:~/TestDir$ ls -l
    total 16
    -rw-rw-r-- 1 test test   14 Jul  2 18:55 'file |'
    drwxrwxr-x 2 test test 4096 Jul  2 19:03 '|folder'
    drwxrwxr-x 2 test test 4096 Jul  2 19:02 'folder |'
    drwxrwxr-x 2 test test 4096 Jul  2 19:03 'folder|'

    test@neon:~/TestDir$ baloosearch6 -d ~/TestDir/ 'file |'
    /home/test/TestDir/file |
    Elapsed: 0,728014 msecs

    test@neon:~/TestDir$ baloosearch6 -d ~/TestDir/ -t folder 'folder |'
    /home/test/TestDir/|folder
    /home/test/TestDir/folder|
    /home/test/TestDir/folder |
    Elapsed: 0,673133 msecs

    test@neon:~/TestDir$ baloosearch6 -d ~/TestDir/ -t folder '|folder'
    /home/test/TestDir/|folder
    Elapsed: 1,24603 msecs
        
You might have been caught by Bug 438850 (this is not quite the bug report I was looking for but it is close enough), where a '-' is treated as special. Maybe a '|' is (or was) similar.
    
It's a long time agao... are you still seeing the problem?