Bug 510149 - Regression: Dolphin file search surrounds terms with double quotes for Baloo searches
Summary: Regression: Dolphin file search surrounds terms with double quotes for Baloo ...
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: search (other bugs)
Version First Reported In: 25.08.1
Platform: CachyOS Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: regression
: 494673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-10-02 02:46 UTC by honpar94
Modified: 2025-12-25 10:48 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description honpar94 2025-10-02 02:46:39 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
When Baloo is enabled, Dolphin's file search automatically surrounds search terms with double quotes, causing issues withe file searching.

STEPS TO REPRODUCE
1. Enable Baloo
2. Enable file indexing
3. Search multiple keywords in Dolphin search

https://www.reddit.com/r/kde/comments/1nv1paj/why_is_dolphins_filename_search_not_working_as_i/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

OBSERVED RESULT
Search results are as if `baloosearch6` were run with keywords surrounded by double quotes.
For example, searching `tutorial shading` in Dolphin runs `baloosearch6 "tutorial shading"`. This results in fewer results than expected, since only files with the keywords in that exact order are returned.

EXPECTED RESULT
Expected results as if search were performed without quotes, e.g. `baloosearch6 tutorial shading` in the above example.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 TraceyC 2025-10-09 00:35:59 UTC
It looks like the behavior has changed in git-master for baloo6, but I can reproduce the bug as described in Dolphin

I created a few test files with unique names

"blinm simnhg"
"simnh blinm"
"blinmsimnh"

On command line I performed a search with and without quotes

 ~/test baloosearch6 simnh blinm
/home/tracey/test/blinm simnh
/home/tracey/test/simnh blinm
Elapsed: 0.298213 msecs

 ~/test  baloosearch6 "simnh blinm"
/home/tracey/test/blinm simnh
/home/tracey/test/simnh blinm
Elapsed: 0.298043 msecs

So the quotes don't affect the search on command line, and I get the results I expected.

In Dolphin, I see all 3 test files returned when I search for "simn" - OK
Searching for "simn blin" however, produces no results. The results should return the same 3 files.
Searching for "simnh blin" produces one file, rather than all three.
Comment 2 tagwerk19 2025-10-14 09:03:37 UTC
(In reply to TraceyC from comment #1)
> ... So the quotes don't affect the search on command line ...
You might be being ambushed by the shell
I would have said that if you want to search for a phrase, you quote it, so:
(In reply to TraceyC from comment #1)
>  ~/test  baloosearch6 "simnh blinm"
> /home/tracey/test/blinm simnh
> /home/tracey/test/simnh blinm
> Elapsed: 0.298043 msecs
*Ought* to give you just:
> /home/tracey/test/simnh blinm
But I suspect the shell has eaten the quotes. You could try quoting the quotes:
    ~/test  baloosearch6 \"simnh blinm\"
or
    ~/test  baloosearch6 '"simnh blinm"'
I think Baloo is doing what it should and it does look like Dolphin is passing a quoted string to it, whereas it didn't before.

I will be a bit adventurous and flag this as a regression (done my testing on Neon Unstable, Plasma 6.5.80, Frameworks 6.20.0)
Comment 3 TraceyC 2025-10-14 22:30:13 UTC
(In reply to tagwerk19 from comment #2)

Either way of escaping the quotes results in an error and only one match, the same thing I got when using quotes in Dolphin

baloosearch6 '"simnh blinm"' 
kf.baloo.engine: PositionDB::iter "simnh" MDB_NOTFOUND: No matching key/data pair found
/home/tracey/test/simnh blinm


> I will be a bit adventurous and flag this as a regression (done my testing
> on Neon Unstable, Plasma 6.5.80, Frameworks 6.20.0)

That would be useful, thanks!
Comment 4 tagwerk19 2025-10-14 22:54:17 UTC
(In reply to TraceyC from comment #3)
> kf.baloo.engine: PositionDB::iter "simnh" MDB_NOTFOUND: No matching key/data pair found
I suspect you have a
    ~/.config/QtProject/qtlogging.ini
file containing something like:
    [rules]
    ...
    kf.baloo.*=true
    ...
in it.

I have seen the diagnostic and not known whether to worry about it. I'm guessing here Baloo's fund "simnh" when looking for the filename but not found it in the content index.
Comment 5 TraceyC 2025-10-15 16:10:20 UTC
(In reply to tagwerk19 from comment #4)
> I suspect you have a
>     ~/.config/QtProject/qtlogging.ini
> file containing something like:
>     [rules]
>     ...
>     kf.baloo.*=true
>     ...
> in it.

That file is on the system, but doesn't have that line. That's fine, at this point the developers should have enough information to investigate further.
Comment 6 Stefan Brüns 2025-11-02 15:25:37 UTC
@TraceC The shell "eats" the quotes, and you have to escape/protect them. All of the following should return the single wanted file:

baloosearch6 \"simnh blinm\"
baloosearch6 '"simnh blinm"'
baloosearch6 'filename:"simnh blinm"'
baloosearch6 filename:\"simnh blinm\"

The first two also search the file contents for a match. This is also likely the cause of the debug message you see ("kf.baloo.engine: PositionDB::iter "simnh" MDB_NOTFOUND: No matching key/data pair found").

baloosearch6 '"simnh blinm"'
is internally transformed to:
baloosearch6 'filename:"simnh blinm" OR content:"simnh blinm" '
Comment 7 Stefan Brüns 2025-11-02 15:34:02 UTC
(In reply to TraceyC from comment #5)
> (In reply to tagwerk19 from comment #4)
> > I suspect you have a
> >     ~/.config/QtProject/qtlogging.ini
> > file containing something like:
> >     [rules]
> >     ...
> >     kf.baloo.*=true
> >     ...
> > in it.
> 
> That file is on the system, but doesn't have that line. That's fine, at this
> point the developers should have enough information to investigate further.

There is also a graphical tool to edit debug levels for each category (i.e. application/library/implementation detail/...). If you hover the mouse cursor over an entry, it will tell you the corresponding category name (e.g "Baloo Engine" - Category name: kf.baloo.engine).

These setting will affect the whole session, and may fill your user session logfile (journal) with a large amount of messages. For debugging, just set the corresponding environment variable:

$> QT_LOGGING_RULES='kf.baloo.*=true;*.debug=false' baloosearch6 \"simnh blinm\"

Note, you can supply multiple rules, the rule above enables full logging for all baloo components, but then disables all debug messages (i.e. only keeping warning/informational messages).
Comment 8 tagwerk19 2025-11-02 17:55:06 UTC
Sorry for the long detail and I hope I've got this right...

For me, these all work as they should:

    $ baloosearch6 simnh blinm
    $ baloosearch6 "simnh blinm"
 
    $ baloosearch6 blinm simnh
    $ baloosearch6 "blinm simnh"

    $ baloosearch6 \"simnh blinm\"
    $ baloosearch6 '"simnh blinm"'
    $ baloosearch6 'filename:"simnh blinm"'
    $ baloosearch6 filename:\"simnh blinm\"

What has just broken is the search box in Dolphin, *IF* the filter is set to "file names". (As far as I can see searching for "File names and contents" works). If I search for

    sim : it works
    simn : it works
    simnh : it works 

    simnh bli : no match 
    simnh blin : no match
    simnh blinm : it works

    'simnh blin' : it works

    bli simnh : no match 
    blin simnh : no match
    blinm simnh : no match

So there is something different (just recently) being done for a filename versus name and contents searches.

This is on a Neon Unstable box, maybe a month behind with updates as I've been getting an "unmet dependencies" failure. I've noticed the filter at times jumping from "File names" to "File names and contents", so it may be worth watching to see what it is set as...
Comment 9 tagwerk19 2025-11-03 07:32:48 UTC
Added a cross reference to the bug in https://invent.kde.org/system/dolphin/-/merge_requests/797#note_1337377, it seems to be something that has changed in Dolphin, "baloosearch" seems solid...
Comment 10 aristsakas 2025-12-25 10:48:02 UTC
*** Bug 494673 has been marked as a duplicate of this bug. ***