Bug 435119 - Search doesn't work.
Summary: Search doesn't work.
Status: ASSIGNED
Alias: None
Product: dolphin
Classification: Applications
Component: search (other bugs)
Version First Reported In: 20.12.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-29 15:49 UTC by Mina
Modified: 2025-04-07 21:09 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Dolphin search dialog when baloo is running (25.61 KB, image/png)
2021-03-29 22:15 UTC, tagwerk19
Details
Dolphin search dialog when baloo is not working (20.02 KB, image/png)
2021-03-29 22:16 UTC, tagwerk19
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mina 2021-03-29 15:49:39 UTC
SUMMARY
Searching in dolphin doesn't return anything.


STEPS TO REPRODUCE
1. Open Dolphin.
2. Ctrl + F.
3. Type a search term.

OBSERVED RESULT
No results after waiting for long.

EXPECTED RESULT
Get results.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.21
(available in About System)
KDE Plasma Version: 5.21.1
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 tagwerk19 2021-03-29 22:15:04 UTC
Created attachment 137169 [details]
Dolphin search dialog when baloo is running
Comment 2 tagwerk19 2021-03-29 22:16:24 UTC
Created attachment 137170 [details]
Dolphin search dialog when baloo is not working

... Not working or has not index that particular folder.
Comment 3 tagwerk19 2021-03-29 22:34:33 UTC
I think the first step is to check whether dolphin is using baloo or not.

Baloo is the indexing service that gathers together all the information about your files, holds it together in a database and uses that to provide the answers to search queries.

If baloo "is running", when you do a Ctrl-F you'll see a search box together with options to display the type of file, the date, a rating that you've given it and any tags you've given it. The dialog looks like the attached "Search-with-Baloo" image

If you have disabled baloo or it is not indexing that particular folder, when you do a Ctrl-F you'll see a dialog like the attached "Search-without-Baloo" image.

However the screenshots show something else, that there are options to search for "filenames" or "content" and also from your working directory or all your files.

You didn't say what you were searching for when you said "Type a search term", a filename or some text inside one of the files?

Try creating a test file in your Documents folder:

    cd ~/Documents
    echo "Hello Penguin" > test-file.txt

and search for "test", you should get a result. If you search for "Penguin" you will only see hits if you have clicked on "Content". Yes, these things are buttons...

You can go back and forth between "Filename" and "Content" and see the difference. If you don't see anything, try clicking on "Your Files"

If you still don't see anything then there's probably some baloo troubleshooting to do.

If the Ctrl-F search dialog looked like the Search-with-Baloo image, make sure it says "Any Type", "Any Date", "Any Rating" and that no tags are specified.

Still nothing? Then it's time to query baloo directly and compare results.

In System Settings "Search", you should see "Enable File Search" checked and your home directory "indexed" in the Folder specific configuration list. Also try the "Also index file content", with that you should be able to find the test file if you search for "Penguin".

At the command line, try a set of commands

    cd ~/Documents
    balooctl status
    balooshow -x test-file.txt
    baloosearch test
    baloosearch Penguin 

The baloostatus should show that baloo is running.

The balooshow would show you what baloo has noted down about your test file.

The baloosearch find matches for 'test' (and should find your file by name) and also files that contain 'Penguin'

If these do not work, try rebuilding the index. In one window, run

    balooctl monitor

which will show a list of files as they are indexed. In a second window, run

    balooctl purge

which will delete the index and start building it again from scratch. You should see the test-file.txt being indexed, you can then try the 'baloosearch' commands again.

Try these things out and see how far you get. It may be that different/older versions of Dolphin and Baloo work slightly differently - but you do say Plasma 5.21 and Frameworks 5.79.0.

It may also be that things work differently if you've been running Neon for a while and started with a far older version and upgraded.

Hope this all makes sense...
Comment 4 tagwerk19 2021-03-30 07:04:14 UTC
(In reply to tagwerk19 from comment #3)
> If baloo "is running", when you do a Ctrl-F you'll see a search box together
> with options to display the type of file, the date, a rating that you've
> given it and any tags you've given it. The dialog looks like the attached
> "Search-with-Baloo" image
That should have been...

    with options to filter the type of file, the date, a rating that you've
    given it and any tags you've given it. 

Oh, well...
Comment 5 Nate Graham 2021-03-31 21:04:36 UTC
Mina, is Baloo running or not? Or are you saying that it doesn't work in either case?
Comment 6 Mina 2021-03-31 21:40:18 UTC
> is Baloo running or not?

Yes it should be running. I have this:

    $ pgrep baloo
    1427814
    1430114

> when you do a Ctrl-F you'll see...

I see something like this https://bugsfiles.kde.org/attachment.cgi?id=137169 which has "any type" & "any date" & "any rating". Therefore baloo should be running.

> Try creating a test file in your Documents folder...

Okay, but I used "~/Documents/TestBaloo" instead, because my Documents folder is quite messy.
   
    $ echo "Hello Penguin" > test-file.txt

And now if I go to that folder and Ctrl + F and search "test" or "Penguin" I get no results.

    $ balooctl status

It stays blank and I have to hit Ctrl + C to exit.

    $ balooshow -x test-file.txt
    test-file.txt: No index information found

...so there's no index. Okay.

    mono@gask:~/Documents/TestBaloo$ baloosearch test
    /home/mono/Sachen/Documents Library/Thesis/template/lstpatch.sty

It returns things from another directory. This is not a full list. And test-file.txt is not in the list.


    $ baloosearch Penguin 
    Elapsed: 15.2315 msecs

Returns nothing.

Now for balooctl monitor in one window and balooctl purge in another window.

The first one:

    $ balooctl monitor
    Press ctrl+c to stop monitoring
    File indexer is running
    Idle

The second one:

    $ balooctl purge
    Stopping the File Indexer
 
 
 
 ............................................................................................................................................................................................................................................................................................................... - failed to stop!

Not sure if you can see the output correctly, but it's just lots of dots and "failed to stop" in the end.

> In System Settings "Search", you should see "Enable File Search" checked and your home directory "indexed"...

Yes it's checked, and home is indexed, and also "Also index file content" is checked.


Hope any of this makes sense.
Comment 7 Mina 2021-03-31 21:42:43 UTC
> It may also be that things work differently if you've been running Neon for a while and started with a far older version and upgraded.

Yeah my neon is with me since 18.04 and I upgraded it to 20.04.
Comment 8 tagwerk19 2021-04-01 07:38:53 UTC
(In reply to Mina from comment #6)
> ... I used "~/Documents/TestBaloo" instead, because my Documents
> folder is quite messy ...
The only reason I suggested "Documents" is that not all distributions index all folders. As far as I can tell, everyone indexes "Documents" :-)

>     $ balooctl status
> 
> It stays blank and I have to hit Ctrl + C to exit.
Never met that! Doesn't sound healthy :-/

>     $ balooctl purge
>     Stopping the File Indexer ............................
> 
> Not sure if you can see the output correctly, but it's just lots of dots and
> "failed to stop" in the end.
Have met that. More in the past, maybe less so recently...

My gut feeling is the baloo index has got corrupted. It happens and in that case the best option is to start again from scratch.

If you cannot do a "balooctl purge", do a "balooctl disable" (which might still fail to stop) and reboot. The "disable" should prevent baloo starting up again when you log back in.

You should then be able to run a "balooctl monitor" in one window, a "balooctl purge" to delete the index and then a "balooctl enable" to start the indexing in a second window (it may be that you need a "balooctl enable" followed by a "balooctl enable" as it sometimes needs to be told twice)

If you have no luck with "balooctl purge", the index file lives at:

    .local/share/baloo/index

and you can stop baloo and delete it manually.

> ... Yeah my neon is with me since 18.04 and I upgraded it to 20.04
There's a Bug 431664 about needing to reindex if you had been running a baloo 5.68 or earlier

> Hope any of this makes sense.
Thank you, yes :-)
Comment 9 tagwerk19 2021-04-08 18:30:09 UTC
(In reply to tagwerk19 from comment #8)
> (In reply to Mina from comment #6) 
> >     $ balooctl status
> > It stays blank and I have to hit Ctrl + C to exit.
> Never met that! Doesn't sound healthy :-/
Now seen some very similar behaviour Bug 435521
Comment 10 Bug Janitor Service 2023-10-27 18:56:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/642
Comment 11 Felix Ernst 2025-04-07 21:09:32 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 458761, bug 471556, bug 475439, 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