Jump to content
mlsquires

Advanced search syntax not uniform

Recommended Posts

Given two notebooks: "Reference" and "ActionsPending" with one note in each with the tag "Books".

I should be able to search for things in the Reference notebook tagged with "Books":

  1. notebook:Reference tag:Books  # Yay! It works
  2. tag:Books notebook:Reference   # Boo! it doesn't work (expression order dependent parsing?)

I should be able to search for things in any notebook tagged with "Books":

  1. tag:Books   # Yay! It works

I should be able to search for everything that is NOT tagged with "Books":

  1. !tag:Books   # Yay! it works

I should be able to search for everything tagged with "Books" that is NOT in the "Reference" notebook

  1. -notebook:Reference tag:Books   # Boo! can't negate the notebook term

How about searching a set of notebooks for a tag?

  1. notebook:Reference notebook:Medical tag:Books   # Boo only one explicit notebook reference

Since I can use some special characters (e.g., ! # " < ...) how about searching for those tags?

  1. tag:=Rob     # Yay! it works
  2. tag:!Daily    # Yay! it works
  3. tag:""Finance  # Meh! If I'm ok with any note that has the word "Finance" in it, then this is ok. But if I really wanted just those notes with the "Finance (note the quote in the tag name) then this doesn't do it

I did these searches on the Windows platform. No idea what the results would be on other platforms (including the API) - likely some differences

Share this post


Link to post

EN search does not support notebook elimination in a search or searching selected notebooks.  To search across a selection of notebooks they must be in a stack.  Relative to your other tag search examples, turn on display search explanation, View - Search Explanation or Ctrl-F10 on Windows.

2 hours ago, mlsquires said:
  • tag:""Finance  # Meh! If I'm ok with any note that has the word "Finance" in it, then this is ok. But if I really wanted just those notes with the "Finance (note the quote in the tag name) then this doesn't do it

Don't think you can/should use " as a prefix for a tag.  The same character is used to differentiate tags with blanks in them, 123 Main Street for example.  I have a tag Finance and if I do the tag:"finance search it actually returns the Finance tagged notes. The "" is ignored basically.  See screen shot.  Same to consider for the wildcard character *.

ScreenClip.png.3f5aaba4fd2a29bcb7ef68785

  • Like 1

Share this post


Link to post

I understand that EN doesn't support notebook exclusion - that's why I titled this "...not uniform". My basic point is that supporting  common logical operators (e.g., "!" or "-") on a *subset* of object types is confusing and limiting.

Either EN allows special characters in object names (e.g., "!" or "\"") or it doesn't. Since it *does* allow the use of those character in tag names there should be a way (e.g., backslash escape, double quote) to escape them in a query. This is a simple UI principal - don't let the system get a user wedged. Disallowing special characters in names might be the course chosen - but right now search is broken for some of my tags.

And the fact that a query expressed as notebook-tag works but one expressed as tag-notebook doesn't is silly.

 

Share this post


Link to post

Special characters do work, I use  !, _, =, +, $ and . myself.  Special characters ", * and # are used for other things in EN so not the best to use. Can be confusing.

Notebook exclusion has been requested many times in the forums, to no avail to date.  I would up vote it as well.  It is uniform in that notebook exclusion does not work on any platform.

Share this post


Link to post
21 hours ago, mlsquires said:

I should be able to search for everything that is NOT tagged with "Books":

  1. !tag:Books   # Yay! it works

I am surprised that using the "!" character to negate a search term actually works since it does NOT conform to the official Evernote Search Grammar.  
In fact, it does NOT work in EN Mac 6.5.
I would recommend against using the "!"  character, since it does not work on all platforms, and could stop working any time.

From Evernote Search Grammar 

Quote

Any matching term may also be negated by adding a "-" character to the beginning. This means that the term will only match a note if the conditional is NOT true.

 

Share this post


Link to post

I'm fine if the only way to express negation is dash "-". If bang "!" is supportied on some platforms and not supported on others is a broader issue than search syntax, but certainly falls under "...not uniform" title.

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