Bug 500414

Summary: Supporting NOT in queries in addition to AND and OR
Product: [Frameworks and Libraries] frameworks-baloo Reporter: pat_h
Component: generalAssignee: baloo-bugs-null
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: john.kizer, tagwerk19
Priority: NOR    
Version First Reported In: 6.10.0   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description pat_h 2025-02-19 14:34:35 UTC
You can create all possible queries with the three basic operators AND, OR and NOT if I remember correctly. However, NOT does not seem to be implemented. It's neither in advancedqueryparser.cpp nor mentioned in baloosearch6.

Using the Shell (here: Fish) you can use the following very crude workaround on the command line:
comm -23 (baloosearch6 "tag:TAG1" 2>/dev/null | sort | psub) (baloosearch6 "tag:TAG2" 2>/dev/null | sort | psub)

But this is obviously not available in, e.g., Dolphin's GUI.
Comment 1 tagwerk19 2025-02-20 13:30:33 UTC
(In reply to pat_h from comment #0)
> ... NOT does not seem to be implemented ...
That's a big ask!

> Using the Shell (here: Fish) you can use the following very crude workaround
> on the command line:
> comm -23 (baloosearch6 "tag:TAG1" 2>/dev/null | sort | psub) (baloosearch6
> "tag:TAG2" 2>/dev/null | sort | psub)
That works, it is effectively a "AND NOT" as in "tag:TAG1 AND NOT tag:TAG2"

You would also have to deal with "NOT tag:TAG1" and maybe even "OR NOT tag:TAG1", there's be a lot of work.


> 
> But this is obviously not available in, e.g., Dolphin's GUI.
Comment 2 John Kizer 2025-03-14 04:23:20 UTC
Hi - merging this in with the existing report on baloo supporting negation in queries, thanks!

*** This bug has been marked as a duplicate of bug 424165 ***