Jump to content
  • 0

(Archived) HOWTO: Search for notes NOT in notebook [NOT CURRENTLY SUPPORTED]


tonylinde

Idea

I store my tweets in a notebook called "Tweets" but they tend to drown out others in the "All Notebooks" list so I thought I'd create and save a search for all notes NOT in the "Tweets" notebook and use that. However, using the search:

-notebook:"Tweets"

and

notebook:"Tweets"

returns the same thing, ie only those notes in the "Tweets" notebook. Obviously, I'm using the syntax wrong. Can someone enlighten me, please?

Thanks,

Tony.

Link to comment

12 replies to this idea

Recommended Posts

You're not using the syntax wrong; Evernote is messing up. The same thing happens to me (3.0.6). What version are you using? I think Evernote knows about this bug, but it's always helpful to report things functioning other than how they should.

EDIT: See below.

Link to comment
  • Level 5*

Simple reason: "-notebook:" is not supported in the search grammar. You can read about the search grammar here: http://dev.evernote.com/documentation/cloud/chapters/search_grammar.php. Although there a section at the top that says "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. Each term in the search may be one of the following:" and seems to contain the "note:" term as well, I believe that that's just not properly described (and should probably be fixed). The "notebook:" term is a "scope modifier" and doesn't count as a negatable "matching term". Anyways, the actual formal grammar at the bottom (http://dev.evernote.com/documentation/cloud/chapters/search_grammar.php#Formal_Search_Grammar) has the real story.

Link to comment
  • Level 5*
You're not using the syntax wrong; Evernote is messing up. The same thing happens to me (3.0.6). What version are you using? I think Evernote knows about this bug, but it's always helpful to report things functioning other than how they should.

Not really, no. This doesn't work, it's never worked since I've been using Evernote, and it's by design (though I don't know the actual motivation for that). I agree that "-notebook:" would be useful, but that syntax is not supported, and it's not a bug.

Link to comment

Sorry for being wrong, and thanks for the correction. But I don't understand this:

Anyways, the actual formal grammar at the bottom (http://dev.evernote...._Search_Grammar) has the real story.

Can you quote the part you're referring to? Where does it say how to perform the search tonylinde was trying to do? I only see

term = "-" negatable

| negatable

;

negatable = literal

| expression

;

and I don't understand what that means.

Link to comment
  • Level 5*
This doesn't work, it's never worked since I've been using Evernote, and it's by design (though I don't know the actual motivation for that). I agree that "-notebook:" would be useful

This feature (being able to exclude a Notebook from a Search) has been requested many times, by many users, for years now.

I have no idea why Evernote would object to providing this important feature. It would be very helpful if they would share their objection, or, better still, provide this feature.

Link to comment
  • Level 5*
Sorry for being wrong, and thanks for the correction.

No worries; it's a bit inconsistent, and as I said, the documentation isn't as clear as t could be.

But I don't understand this:

Anyways, the actual formal grammar at the bottom (http://dev.evernote...._Search_Grammar) has the real story.

Can you quote the part you're referring to? Where does it say how to perform the search tonylinde was trying to do? I only see

term = "-" negatable

| negatable

;

negatable = literal

| expression

;

and I don't understand what that means.

That's pretty close, but it's not the whole story. This part says that a term is a 'negatable' item, and it can appear with or without a '-'. If 'notebook' were a negatable item, then it would count, too. But it's not; to find out why, you have to dig a little deeper. First, let's discard the 'literal' part:

literal = word | quoted | prefix ;

word = wordchar , { wordchar } ;

quoted = '"' , { ( any - '"' ) | '\"' } , '"' ;

prefix = { wordchar } , "*" ;

That's just a piece of text, quoted or unquoted, and possibly with a terminating '*' wildcard character. Let's look at the other: expression:

expression = label , ":" , value ;

(*

* Expression labels must be:

* The name of a NoteAttribute field (e.g. "subjectDate")

* or a ResourceAttribute field (e.g. "fileName"),

* or one of: "tag", "intitle", "created", "updated", "resource",

* "todo", or "encryption".

* Search results are undefined if an unknown label is used.

*)

label = word ;

OK, well, that *looks* like the notebook, except that 'notebook' isn't mentioned as one of the possible labels (in the (*...*) comment).

So the actual answer is back up the tree a bit, actually right at the top:

search = [ notebook , separator ] ,

[ "any:" , separator ] ,

term ,

{ separator , term } ;

notebook = "notebook:" , ( word | quoted ) ;

This says that a search is an optional 'notebook' term, followed by an optional 'any:' modifier, followed by a list of terms (which we just looked at). We can follow the 'notebook' term out to see that it's "notebook:" followed by a word.

So notebook is separate from the negatable items, and it must appear first in a valid search, even before the "any:" modifier.

Make sense?

Link to comment

Make sense?

Haha, no, because I got lost at "literal = word | quoted | prefix ; ." But that's not your fault; it's Evernote's/mine. I'll take your word that there's some logic behind it.

I wish Evernote would explain these things in English somewhere—correctly.

Link to comment
This doesn't work, it's never worked since I've been using Evernote, and it's by design (though I don't know the actual motivation for that). I agree that "-notebook:" would be useful

This feature (being able to exclude a Notebook from a Search) has been requested many times, by many users, for years now.

I have no idea why Evernote would object to providing this important feature. It would be very helpful if they would share their objection, or, better still, provide this feature.

Notebooks (contrary to tags) are a perfect attribute to sort notes because each note can be only in a single notebook.

The only problem is that you can't exclude a Notebook from a Search.

That's pretty much the only reason why I use keywords in titles instead of notebooks to define Types of notes, i.e. whether a note is a bookmark or a video or an image or an article or a mind map and so on.

Tweet would also make perfect sense to use as a Type btw.

Notebooks are useful for this because a note can't be both a tweet and an article, or a an image and a video and etc., you get the idea...

You can use tags for this but then you loose the useful ability to sort notes nicely, so I add a Type of a note to a title and then I sort by title. It works but Notebooks would be more convenient - the search problem kills it for me though. IMHO it doesn't make any sense :)

Link to comment
  • Level 5*
I wish Evernote would explain these things in English somewhere—correctly.

Yeah, that document containing the grammar is actually aimed at developers, so it may not be all that approachable. It's not that hard conceptually, but it can take a bit of time getting the hang of things. Basically it's just a set of rules that allow you (or the computer) to recognize a valid search string. I won't bore you with the details (not that I find it boring), unless you really want to know, or you could make a start on the Wikipedia page for 'BNF': http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form.

Link to comment

Archived

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

×
×
  • Create New...