SUMMARY: A review of the differences between Dolphin's filenamesearch and baloosearch - surprises and traps for the unwary. BASE ISSUE: Dolphin search asks baloo when it thinks baloo has indexed the folders. If Dolphin thinks baloo has not indexed the files, it will fall back to using it's own "there and then" search. The two searches behave differently You can see whether Dolphin will ask baloo or doing a "there and then" search by looking at the search prompt. If you do a Ctrl-F to get the prompt and it looks like this: https://bugsfiles.kde.org/attachment.cgi?id=137170 then you will be doing the "there and then" (filenamesearch) search. If however you see extra search options as here: https://bugsfiles.kde.org/attachment.cgi?id=137169 then Dolphin knows it can ask baloo for its search results (baloosearch) As always this is a "best efforts" summary, no doubt there's something I've missed, quite likely something I've got wrong. The behaviours have been checked on Neon Testing and Fedora 36. TERMINOLOGY: Beware, there are twisty passages all alike... Dolphin can call baloo or do its own "there and then" search, the code it uses to do these are "baloosearch" and "filenamesearch". The search prompts you get are dependent on which code Dolphin has decided to use. Separately, Dolphin gives you options for searching for filenames or content. A "filename" search and the filenamesearch code are not related and a "content" search does not necessarily depend on baloo. Dolphin tries to provide search functions irrespective of whether baloo is enabled. There is also a command line "baloosearch", useful for troubleshooting. OBSERVED RESULTS: These are split up into "traps for the unwary" for Dolphin's "there and then" search, listed under Comment 1, and for Dolphin's "baloo" searches, listed under Comment 2 WISHED FOR RESULTS: Ideally, Dolphin should give the same results (as far as is possible) irrespective of whether it is asking baloo or doing its own search. Dolphin should ask baloo whether it has indexed a folder, rather than assume it has (or hasn't). If baloo has indexed a folder, Dolphin should query baloo in preference to doing its own "there and then" search.
OBSERVED RESULTS: "There and Then" searches... If Dolphin gives a simple prompt: https://bugsfiles.kde.org/attachment.cgi?id=137170 It will do a "there and then" search, calling "filenamesearch". Despite the name, "filenamesearch" can do either "Filename" or "Content" searches. 1... If you are have clicked on "content", you will not get matches from the filename. This may not be what you expect. 2... Content search is limited in comparison to baloo's search. You can search through text files but not documents. You will also not search xattr or embedded (such as EXIF or ID3) tags. 3... You can search for parts of words, looking for "amp" will find you "example" as well as "ampersand". Wildcards as you might expect them to work, don't. 4... Searches for the phrase "as is", which is straightforward and predictable. You don't get any "search logic", so looking for "one three" will not find "one two three" or "three one" 5... If you are typing a search phrase, you will start getting shown matches after typing the first character. 6... The recursive search follows symlinks. If you've set up links to folders outside your home directory, the search will follow them. This is probably the expected behaviour. You may find that files are "found" more than once. 7... It can be slow
OBSERVED RESULTS: Dolphin using baloo's index... If Dolphin gives you additional options in the search prompt: https://bugsfiles.kde.org/attachment.cgi?id=137169 then Dolphin thinks that baloo has indexed the data and can give faster and more comprehensive results. If you have baloo disabled or you have moved to folder in Dolphin that is excluded from indexing, Dolphin will do a "there and then" search (comment 1) and you won't see the additional options. 1... If you have baloo enabled but haven't enabled "content indexing", you won't be able to do "Content" searches (Bug 446387) 2... You cannot use wildcards. Looking for "amp" will find you "ampersand" but not "example", "*amp*" will not get you anything (Bug 453291) 3... Provides search logic; a search for "one three" is treated as a search for "one AND three" so it will find "one two three" (and also "three two one"). You can quote the search phrase to find the exact match The search logic behaves differently depending on whether you are searching for filenames or content: With baloosearch, if you search for "content" in Dolphin, the search will look for matches in both the filename and the content. When searching for filenames a search for "file - 1" seems to ignore the "-" and looks for filenames containing "file" and "1" However when doing a content search, searching for "file - 1" will not find the file. There's something strange with the handling of "separators", such as a "-" (Bug 434589) Issues with hyphens arise more frequently than expected as they are often used in track names, as in Bug 438850: https://bugsfiles.kde.org/attachment.cgi?id=139469 4... If you are typing a search phrase character by character, you will notice: In filename searches, you will get exact matches even if you type a single character, so searching for "1" will find a "file 1" but not "file 1a" Again in a filename search, if you don't find an exact match, you need to type two characters, so you need to type "fi" to find "file 1" In content searches, you need to type three characters to find matches within the content. 5... You can search metadata, examples include searching for anything changed in the last week or anything with a two star or more rating. In order to search for embedded EXIF or ID3 tags you need to have "content indexing" enabled. 6... Dolphin makes assumptions about whether baloo has indexed a folder - which may not be right. Baloo does not follow symlinks when indexing so if you move to a symlinked folder in Dolphin and do a search "From Here", you will not will not get any results (Bug 442786 and the summary in Bug 447119). 7... Baloo does not index "remote" filesystems. If you move to a remote folder in Dolphin and search from it, you will be doing a "there and then" search.
If dolphin is doing its own "There and Then" searches... Dolphin will not search down into "hidden" folders. You can see hidden files and folders if you enable "Show Hidden Files" but a Dolphin "There and Then" search will not list hidden files in the results or hunt down into hidden folders. If dolphin is using baloo's index... The behaviour depends on whether baloo is "Indexing hidden files and folders", if so: You will see hidden files in the results if you have enabled "Show Hidden Files". The search will list normal files in hidden folders. See Bug 467216.
Baloosearch and filenamesearch use different syntax for booleans, to search for AAA or BBB you would: With filenamesearch type: AAA|BBB With baloosearch type: AAAA OR BBB The filenamesearch syntax does not work with baloosearch and vice versa
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/408
Git commit 7c5158ec9863ffc754b2ad88bfd0b80626470787 by Méven Car, on behalf of Archaeopteryx Lithographica. Committed on 18/02/2025 at 10:49. Pushed by meven into branch 'master'. filenamesearch: Allow to search hidden files/folders Previously we only searched visible files and this is distinct from whether Dolphin shows hidden files or not. If you display hidden files with a Ctrl-H and then search, you don't find any hidden files. Add a "&includeHidden=yes" argument in the filenamesearch:/ url. Add tests in the filenamesearch autotests for searching for hidden files and within hidden folders. A +1 -0 filenamesearch/autotests/data/hiddenFilesAndFolders/.alice2.txt A +1 -0 filenamesearch/autotests/data/hiddenFilesAndFolders/.hidden/.alice4.txt A +1 -0 filenamesearch/autotests/data/hiddenFilesAndFolders/.hidden/alice3.txt A +1 -0 filenamesearch/autotests/data/hiddenFilesAndFolders/alice1.txt M +63 -2 filenamesearch/autotests/filenamesearchtest.cpp M +12 -3 filenamesearch/kio_filenamesearch.cpp M +6 -1 filenamesearch/kio_filenamesearch.h https://invent.kde.org/network/kio-extras/-/commit/7c5158ec9863ffc754b2ad88bfd0b80626470787
Git commit 3d0934ad9fd80bf705b946d4b2928bbe91f4a8a5 by Méven Car, on behalf of Archaeopteryx Lithographica. Committed on 14/03/2025 at 19:19. Pushed by meven into branch 'master'. Filenamesearch: also find filename matches in a content search The existing code does not match against the filename when doing a content search. This is probably not what people expect. M +0 -1 filenamesearch/autotests/filenamesearchtest.cpp M +5 -3 filenamesearch/kio_filenamesearch.cpp https://invent.kde.org/network/kio-extras/-/commit/3d0934ad9fd80bf705b946d4b2928bbe91f4a8a5
drop baloo and all this other bs gimmicks. find works fine, get the output and parse it.