Jump to content

Search query for any of certain tags excluding another tag


Recommended Posts

For example I have 3 tags:

  • home
  • work
  • completed

I'd like to make a search query, to show any notes with "home" or "work" tags, without "complete" tag. How can I do it?

I've tried

 -tag:completed any: tag:home tag:work

It doesn't work

 

Link to comment
  • Level 5*

EN search does not support Boolean search, that is AND and OR combined.  It is either AND (must contain all of the tags) or ANY (can contain any of the tags).

Workaround is to do an ANY search for Home and Work tags, add a temp tag to those notes, and then do an AND search for Temp -Completed tags.

Boolean search has been requested many times, so you are not alone looking for it.

Link to comment
  • Level 5*
13 hours ago, sunsuni4 said:

I'd like to make a search query, to show any notes with "home" or "work" tags, without "complete" tag. How can I do it?

Another workaround is to assign a common prefix to the tags you want to include:

  • .NB.Home
  • .NB.Work

I use the ".NB." prefix to denote pseudo Notebooks.  You can, of course, choose any prefix that makes sense to you.
This is easy to do using the Tag View, and immediately applies to all Notes with the tag you change.

Then your search is:
-tag:completed tag:.NB.*

Link to comment
  • 1 month later...
On 31.01.2016 at 2:45 AM, JMichaelTX said:

Another workaround is to assign a common prefix to the tags you want to include:

  • .NB.Home
  • .NB.Work

I use the ".NB." prefix to denote pseudo Notebooks.  You can, of course, choose any prefix that makes sense to you.
This is easy to do using the Tag View, and immediately applies to all Notes with the tag you change.

Then your search is:
-tag:completed tag:.NB.*

Good point, I think I will try this technique!

Link to comment

1. One could additionally tag any task-related notes with, say, "tasks" as part of your workflow. Then you wouldn't need temporary tags to group multiple sets of tags ("home" and "work") in order to then exclude another ("completed"). And similarly, if you wanted to exclude "work" or "home", you'd filter for "tasks" and exclude whatever:

  • tag:tasks -tag:completed
  • tag:tasks -tag:home
  • tag:tasks -tag:work

OR...

2. If you put your notes with "home" or "work" tags into a "Tasks" notebook, you can then filter for -tag:completed. Similarly, one could filter out any other individual (or multiple tags) you want.

One needs a broader container for a category, whether it be a tag or a notebook.  

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...