-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
What feature or improvement do you think would benefit Files?
Feature: Support for a logical NOT operator in tag searches to exclude specific tags from search results.
The current tag search system in Files supports logical AND (via commas) to locate items that contain multiple tags. However, there’s currently no way to exclude files that match certain tags.
Adding support for a NOT operator (e.g., tag:Trip-Photos NOT tag:Mountains or tag:Trip-Photos -tag:Mountains) would make Files’ tagging system much more powerful and flexible, enabling users to precisely filter what they want to see.
Use Case
A user has photo files tagged Trip-Photos, Family, and Mountains. They want to find all files tagged Trip-Photos, but not the ones that are also tagged Mountains — for example, to view city or beach photos from the same trip without mountain shots mixed in.
A photographer uses tags like Portrait, ClientX, and Private. They could search for tag:Portrait NOT tag:Private to find only public portraits.
A project manager tracks tasks with Pending, Done, and Archived tags. They might use tag:Pending NOT tag:Archived to see only active work.
Requirements
Define NOT Syntax:
Introduce a clear syntax for exclusion. Possible options:
tag:Trip-Photos NOT tag:Mountains
tag:Trip-Photos -tag:Mountains
tag:Trip-Photos,!Mountains
Update Search Parser Logic:
Modify the tag search parser to correctly interpret the NOT/exclusion syntax. The query should return files that match the inclusion tag(s) but exclude any that have the listed exclusion tag(s).
Maintain Backwards Compatibility:
Ensure existing tag searches using commas for logical AND continue to work as-is.
(Stretch Goal) Combine with AND/OR:
Allow mixed use of logical operators for complex searches, such as:
tag:Important,(ProjectA|ProjectB) NOT tag:Archived
Update Documentation:
Add examples of NOT usage to the in-app tooltip and official documentation.
Files Version
4.0.11.0
Windows Version
10.0.19045
Comments
The NOT operator would complete the logical search trio (AND, OR, NOT), giving Files a truly powerful tag query system comparable to professional-grade file management tools.
This enhancement would make it easy for users with large, tag-based collections (like photographers or travelers) to exclude irrelevant subsets of data without creating duplicate tag hierarchies or performing multiple manual searches.
See #17694 for (AND, OR) Request