Search by NOT "-" Tag broken? see: tag:red -tag:blue

This simple search does not seem to work correctly. I simplified the test as much as possible for faster testing. Please correct me if I am mistaken with the search string.

Any help would be greatly appreciated!

Thank you,
Snow

Steps to reproduce

Simple search create a page:

#this is a tag search test

more

this is a red tag #red

that

this is a blue tag #blue

this

This is a red and blue take #red #blue


then search. all of this works is as expected:
tag:red
tag:blue
tag:red tag:blue

This search below does not work as expected:
tag:red -tag:blue

Expected result

does not return any results BUT I believe should return
this is a red tag #red

Actual result

Environment

  • Debug info:

Additional information

Search works on a document basis. So when you’re asking it to search for all notes that include tag red but not tag blue, nothing should show up.

What you’re looking for are probably the line or block operators

See the docs:

Thank you @koala ! This provides the correct answer.
Hope the syntax is correct.

block:(#red -#blue)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.