Bug 475439

Summary: Dolphin search doesn't find .db files
Product: [Applications] dolphin Reporter: wooden445
Component: searchAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: dolphin-bugs-null, justin, nate, postix, tagwerk19
Priority: NOR    
Version First Reported In: 23.04.0   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=489922
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description wooden445 2023-10-10 17:08:30 UTC
SUMMARY
Searching for the file extension .db returns no hits, even though the file exists. Searches for other extensions like .pdf and .jpg work as expected. 

STEPS TO REPRODUCE
1. Create a file with extension .db (test.db)
2. Press CTRL + F
3. Search for .db

OBSERVED RESULT
No files are found.

EXPECTED RESULT
Finding test.db.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 23.04
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
With some testing I created another file with the file extension .banana (test.banana). I don't find the file if I search for .banana in the same folder, but I do find it if I run the search from its parent folder. find ./ -type f -name "*.[extension]" finds both files.
Comment 1 tagwerk19 2023-10-10 18:24:29 UTC
You have Baloo running?

I think if you look in the baloo configuration file:
    ~/.config/baloofilerc
you'll see "*.db" included in the "exclude filters" list.

My assumption up until now was that these excludes were to stop baloo trying to content index these extensions (which could get messy), not exclude them completely from indexing...
Comment 2 wooden445 2023-10-10 20:31:36 UTC
(In reply to tagwerk19 from comment #1)
> You have Baloo running?
> 
> I think if you look in the baloo configuration file:
>     ~/.config/baloofilerc
> you'll see "*.db" included in the "exclude filters" list.
> 
> My assumption up until now was that these excludes were to stop baloo trying
> to content index these extensions (which could get messy), not exclude them
> completely from indexing...

Thanks, it seems removing the exception from baloofilerc does make .db searchable. I readded the exception and disabled file indexing, but .db remains unsearchable then too.

For some reason changing these settings also got the .banana searches to work.

Maybe the search screen could indicate that there are excluded search results, as well as an exception setting on the File Search settings page?
Comment 3 Nate Graham 2023-10-11 18:58:05 UTC
Maybe what we should do is have Baloo still index files by name if they're in the exclusion list, just not by content? We definitely don't want to content-index .db files, but not finding them at all also feels wrong to me.
Comment 4 wooden445 2023-10-14 03:04:36 UTC
(In reply to Nate Graham from comment #3)
> Maybe what we should do is have Baloo still index files by name if they're
> in the exclusion list, just not by content? We definitely don't want to
> content-index .db files, but not finding them at all also feels wrong to me.

Yes, that sounds like a big improvement!
Comment 5 tagwerk19 2024-07-08 12:00:17 UTC
(In reply to wooden445 from comment #0)
> With some testing I created another file with the file extension .banana
> (test.banana). I don't find the file if I search for .banana in the same
> folder, but I do find it if I run the search from its parent folder. find ./
> -type f -name "*.[extension]" finds both files.
I thought I ought to try indexing a banana, not something I've tried before :-)

    test@neonunstable:~/Testdir$ echo "Hello Penguin" > testfile.banana

    test@neonunstable:~/Testdir$ kmimetypefinder testfile.banana
    text/plain

    test@neonunstable:~/Testdir$ balooshow6 -x testfile.banana
    1417afed0da2dd 3977093853 1316783 testfile.banana [/home/test/Testdir/testfile.banana]
            Mtime: 1720439519 2024-07-08T13:51:59
            Ctime: 1720439519 2024-07-08T13:51:59
            Cached properties:
                    Line Count: 1

    Internal Info
    File Name Terms: Fbanana Ftestfile 
    XAttr Terms:
    Plain Text Terms: hello penguin
    Property Terms: Mplain Mtext T5 T8 X20-1 
    lineCount: 1

    test@neonunstable:~/Testdir$ baloosearch6 testfile.banana
    /home/test/Testdir/testfile.banana
    Elapsed: 0.873044 msecs

The important bit is that it is "text/plain" other banana types may not be indexable...
Comment 6 Justin Zobel 2025-02-08 00:16:35 UTC
I think we should turn this bug report into a feature request.

It would be for baloo, and it would be to introduce separate filters.

File name indexing would find index files no matter what, which is logical.

File content indexing would have be filtered so .db files and other things that don't make sense to index aren't.
Comment 7 Felix Ernst 2025-04-07 21:10:04 UTC
Git commit 4102ccb80457eea44ea280f0ace2a419602bc34b by Felix Ernst.
Committed on 07/04/2025 at 21:09.
Pushed by felixernst into branch 'master'.

Rewrite search integration

This huge commit is a nearly complete rewrite of the Dolphin search
code. It implements most of the improved Dolphin search UI/UX as
designed and discussed in a collaborative effort by Kristen McWilliam,
Jin Liu, Andy Betts, Tagwerk, a few others and me.
See https://invent.kde.org/system/dolphin/-/issues/46.

# Notable changes

- A toggle to change the search tool is provided as most contributors
deemed that useful in
https://invent.kde.org/system/dolphin/-/merge_requests/642#note_985112.
- The default search is changed to filenamesearch for maximum
reliability.
- Removing all search parameters will take users back to the view state
prior to starting a search instead of keeping the search results open.
- The UI for choosing file types or modification dates has been made
more powerful with more granularity and more options.
- Most search parameters can be configured from a popup menu which
gives us extra space for extra clarity.
- Labels and help buttons as well as hyperlinks to settings makes sure
the user always knows why some search parameters are unavailable in
some contexts.
- Chips show important search parameters while the popup is closed.
They allow quickly removing filters.
- The titles of the search and the input field placeholder message
change to make clear whether file names or file contents are searched.
- When the user actively switches the search tool, whether content
should be searched, or whether to search everywhere, this is preserved
for the initial state of the search bar when the user opens it the next
time after restarting Dolphin.

# Architecture

- The new DolphinQuery class is independent of the UI and contains all
search parameters modifiable in Dolphin as easy setters and getters.
- DolphinQuery objects are also used to update the states of every
component in the search UI. There is now a clear separation of UI and
search configuration/DolphinQuery.
- DolphinQuery is responsible for exporting to and importing from
search URLs.
- The search UI always reflects the currently configured DolphinQuery
no matter if the user changed the UI to change the DolphinQuery or
loaded a DolphinQuery/older search URL which then is reflected in the
UI.
- I tried to simplify all classes and their interaction between each
other as much as possible.
- I added some tests
Related: bug 386754, bug 446387, bug 470136, bug 480001, bug 483578, bug 488047, bug 488845, bug 500103, bug 435119, bug 458761, bug 471556, bug 477969
FIXED-IN: 25.08

M  +19   -4    src/CMakeLists.txt
M  +5    -0    src/config-dolphin.h.cmake
M  +22   -17   src/dolphinmainwindow.cpp
M  +2    -6    src/dolphinrecenttabsmenu.cpp
M  +103  -130  src/dolphinviewcontainer.cpp
M  +41   -30   src/dolphinviewcontainer.h
M  +2    -2    src/global.h
A  +356  -0    src/search/bar.cpp     [License: GPL(v2.0+)]
A  +206  -0    src/search/bar.h     [License: GPL(v2.0+)]
A  +150  -0    src/search/barsecondrowflowlayout.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +48   -0    src/search/barsecondrowflowlayout.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +52   -0    src/search/chip.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +101  -0    src/search/chip.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +0    -0    src/search/configurationpopup.h     [License: Trivial file]
M  +5    -1    src/search/dolphin_searchsettings.kcfg
D  +0    -312  src/search/dolphinfacetswidget.cpp
D  +0    -84   src/search/dolphinfacetswidget.h
M  +339  -70   src/search/dolphinquery.cpp
M  +278  -37   src/search/dolphinquery.h
D  +0    -575  src/search/dolphinsearchbox.cpp
D  +0    -189  src/search/dolphinsearchbox.h
A  +378  -0    src/search/popup.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +99   -0    src/search/popup.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +61   -0    src/search/selectors/dateselector.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +42   -0    src/search/selectors/dateselector.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +81   -0    src/search/selectors/filetypeselector.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +36   -0    src/search/selectors/filetypeselector.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +51   -0    src/search/selectors/minimumratingselector.cpp     [License: GPL(v2.0+)]
A  +42   -0    src/search/selectors/minimumratingselector.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +189  -0    src/search/selectors/tagsselector.cpp     [License: GPL(v2.0+)]
A  +45   -0    src/search/selectors/tagsselector.h     [License: GPL(v2.0+)]
A  +56   -0    src/search/updatablestateinterface.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +67   -0    src/search/widgetmenu.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +63   -0    src/search/widgetmenu.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
M  +3    -3    src/tests/CMakeLists.txt
M  +1    -1    src/tests/dolphinmainwindowtest.cpp
M  +214  -64   src/tests/dolphinquerytest.cpp
A  +124  -0    src/tests/dolphinsearchbartest.cpp     [License: GPL(v2.0+)]
D  +0    -63   src/tests/dolphinsearchboxtest.cpp

https://invent.kde.org/system/dolphin/-/commit/4102ccb80457eea44ea280f0ace2a419602bc34b