Bug 428950 - Dolphin's Search does not respect wildcards and ignores period symbol
Summary: Dolphin's Search does not respect wildcards and ignores period symbol
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: search (show other bugs)
Version: 20.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2020-11-11 03:10 UTC by Tyson Tan
Modified: 2023-05-21 09:15 UTC (History)
6 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 Tyson Tan 2020-11-11 03:10:06 UTC
Dolphin's Search does not respect wildcards.

For example, if I want to search all files with the extension name .tar:

If I searched for "*.tar"
It returns nothing.

If I searched for ".tar"
It ignores the period and lists everything that has "tar" in it.

Workaround:
1) Search for tar
2) Ctrl+I to call up Filter bar
3) Filter the result with .tar
or
Use KFind (which is not installed by default by many major distros including Kubuntu)

This problem makes precise searching in Dolphin very confusing and troublesome. Is it possible for Dolphin to respect wildcards? Or can we let it to at least respect the period symbol so we can at least have an easy workaround? Thank you.
Comment 1 Ahmad Samir 2021-11-03 17:21:41 UTC
If you don't have baloo enabled, kio_filenamesearch is used, which doesn't support wildcards (never did, AFAICS), for regex:
. matches any one character
.* matches any number of characters
\. matches a literal '.' character

for example:
.*tar\.xz

will only match foobar.tar.xz
Comment 2 Greg Lepore 2021-11-03 17:33:05 UTC
I can confirm that ., .\, and .* seem to work, but .*tar\.xz does not appear to match foobar.tar.xz on my machine.


Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.3
Kernel Version: 5.4.0-89-generic (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 2600 Six-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: GeForce GT 1030/PCIe/SSE2
Comment 3 SigHunter 2023-05-21 09:15:12 UTC
I stumbled upon this behavior yesterday and IMO it is very confusing to users and took me some time to analyze:

In short:
baloo enabled (default):
basic wildcard search (like *.jpg for all jpg files) works ONLY for indexed folders but wildcards don't work for non indexed folders and network shares mounted via dolphin

baloo disabled:
basic wildcards never work (*.jpg no results)


The documentation https://docs.kde.org/stable5/en/dolphin/dolphin/quick-tips.html specificially states that wildcards should yield the same results as without wildcards
"The search is case insensitive, and does not require surrounding wildcards (*foo* and foo are equivalent), but you can use wildcards inside the search term. * will match zero or more characters, ? only one single character."


Expected fix: 
the search provider for everything that is not baloo indexed (I guess this is kio_filenamesearch) should support wildcards, like searching in baloo indexed folders does. the search syntax should be identical. having different search results depending on search location is confusing and feels unreliable. I want to be able to trust the file search. 

Sure, using regex could be a workaround for advanced users, but is only necessary for those non-indexed folders or when baloo is disabled. you have to specifically know this behavior and regex is not user friendly, a basic *.jpg search should always work, like it does in mlocate or windows


Dolphin 23.04.01 and KDE 5.27.5 on Gentoo