Jump to content
sunsuni4

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

 

Share this post


Link to post

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.

  • Like 1

Share this post


Link to post
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.*

  • Like 2

Share this post


Link to post
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!

  • Like 2

Share this post


Link to post

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.  

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...