Bug 494584 - Dolphin search for a quoted phrase gives no hits
Summary: Dolphin search for a quoted phrase gives no hits
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-12 09:00 UTC by tagwerk19
Modified: 2024-10-13 14:09 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tagwerk19 2024-10-12 09:00:37 UTC
SUMMARY:
    If Baloo is disabled, a Dolphin search for a quoted phrase gives no hits

STEPS TO REPRODUCE:
1...
    Make sure Baloo is disabled or not indexing your test folder

2...
    Create a test file:

        $ echo "Hello Penguin" > letter-to-mary.txt

3...
    Open Dolphin search, choose a Content search and type, with the quotes,
    "Hello Penguin"

OBSERVED RESULT:   
    You don't get any results
    
    However if you search without the quotes you do get hits for exact matches.
    This is a bit messy as, with Baloo, you need quotes for an exact search, without
    Baloo you cannot use quotes

EXPECTED RESULT:
    You should get hits for exact matches

SOFTWARE/OS VERSIONS:

    Neon Unstable
    Dolphin: 24.11.70
    Plasma: 6.1.90
    Frameworks: 6.7.0
    Qt: 6.7.2

ADDITIONAL INFORMATION:
    This is specific as Dolphin's internal search. It has not yet been tested
    with the coming ripgrep (rg/rga) based search.
Comment 1 Jin Liu 2024-10-13 03:22:15 UTC
Can confirm. The search string is treated as a regular expression, so quote only matches the quote character.

The rg/rga will have the same behavior as the internal search.

I don't think we can make grammar in the internal search backend very close to Baloo. (unless we make them sharing the same query processor, i.e. make the internal backend a "Baloo running in unindexed mode".) So we need a decision on to what extent their grammars should match.

For reference, the file manager in both GNOME (Nautilus) and COSMIC (COSMIC Files) don't support quotes.
Comment 2 tagwerk19 2024-10-13 14:09:19 UTC
(In reply to Jin Liu from comment #1)
> Can confirm.
Thank you!

> ... The search string is treated as a regular expression, so quote
> only matches the quote character ...
I think a regex is beyond what people would expect. Would you ask people to type "Letter.*Mary" in order to find "letter-to-mary.txt"? Or explain why a search for "Mar*" found "Maggie"?

Of course there can/should be a flag to say "treat this is as a regex" for the Computer Science students ;-) but the normal expectation would be that you give a collection of terms (as you might in Google) and the back-end does it's best to satisfy your request. If you've quoted a phrase, then the search should be for that phrase.

> ... So we need a decision on to what extent their grammars should match ...
To start with, if you are putting work into the code, don't add to the divergence. Then, where possible, follow the principle of "fewest surprises". The behaviour with search terms and quotes is a very good example.

> ... For reference, the file manager in both GNOME (Nautilus) and COSMIC (COSMIC Files) don't support quotes ...
I know this was an aside at the bottom of the post - but the fact that we don't it because Gnome doesn't do it is a dodgy argument 8-)