Jump to content

Search using multiple "-tag:"


Recommended Posts

I asked the following question of Support (which they couldn't answer BTW), but was able to come up with a solution. Thought it might be useful for someone else.

  • YOUR QUESTION:
  • How can I perform the following search?
  • tag:motorcycles AND (-tag:bike.small OR -tag:blike.med OR -tag:bike.large)
  • I use Evernote on the following O/S's: Android, iOS, Windows 10.

Found the following works:

tag:motorcycles (-tag:bike.small -tag:bike.med -tag:bike.large)

HTH.

(Apologize if this has already been covered. I wasn't able to find anything using Google.)

Link to comment
  • Level 5*

Evernote does not allow combined and/or search in its search language. There are no 'AND' or 'OR' operators in the search language. There is limited ability to do and/or searches using wildcards. I'd be really surprised if the parentheses actually do what you think they're doing; they're not allowed by the Evernote search grammar (reference here: https://dev.evernote.com/doc/articles/search_grammar.php). When I plug the search "tag:motorcycles (-tag:bike.small -tag:bike.med -tag:bike.large)" into the Windows client, the search explanation looks like this:

image.png.164635baa2037b7cd851e00bf5dbb3e6.png

BTW, note the test for notes not tagged with 'bike:large)', with a parenthesis included. That's apparently legal, but not the same as the tag 'bike.large'. We'll ignore that.

Anyways, in Evernote, this is exactly equivalent to the pure AND search: "tag:motorcycles -tag:bike.small -tag:bike.med -tag:bike.large" that we get by removing the parentheses. Try it; the search explanation is the same, as should be the search results more traditional formulation would be: "tag:motorcycles AND -tag:bike.small AND -tag:bike.med AND -tag:bike.large". This is a very different search than "tag:motorcycles AND (-tag:bike.small OR -tag:bike.med OR -tag:bike.large)"

Anyways, this is equivalent to a search of "tag:motorcycles AND (-tag:bike.small AND -tag:bike.med AND -tag:bike.large)", which Evernote translates as "show me all the notes tagged with

So let's ask the question "what are you trying to do here?". Are you trying to locate notes tagged with 'motorcycle' and not tagged with any of the 'bike.*' tags? 

 

  • Like 1
Link to comment
  • 3 months later...

jefito is wrong - Evernote by default applies an AND to all arguments.

You can get a limited OR effect with the any: operator which applies an OR to all arguments, regardless of where it appears in the search.

As the search grammar says

Quote

Evernote's search grammar is a simple list of terms which are evaluated within a notebook (or "all notebooks") to find a match. By default, the search results are the intersection of the notes that match each individual search term. This behavior changes if the "any:" modifier is found in the search. In this case, the search is executed as a union of the matches of the individual terms, and notes will be returned that match any of the criteria terms.

However, your specific search example can be achieved using a wildcard on the tag, to get everything tagged with motorcycles which does not have a bike.something tag.

tag:motorcycles -tag:bike.*

Link to comment

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...