Jump to content
Introducing 'Templates' for Evernote Read more... ×
Notebook Limit Increase Read more... ×
agsteele

Strange Search Result - Any ideas?

Recommended Posts

In one of my Evernote notebooks I keep several notes which detail Linux server commands/syntax for task I do infrequently and can never remember the exact syntax.  One of these is for the htpasswd command.

I have a document which refers, in several places. to .htpasswd and htpasswd.  An example of one piece of text in the note is:

Quote
To add additional user/password pairs type:
htpasswd .htpasswd fred

By chance I needed to refer to the note to be reminded of the syntax as in the Windows desktop I did the following:

  1. Checked that all notes was selected
  2. typed passwd in the search box
  3. no note was found

I then repeated and typed passw and the note was located. Similarly typing htpasswd or .htpasswd worked but not passwd

I'm truly puzzled. Does anyone have insight?

Andrew

Share this post


Link to post
4 hours ago, agsteele said:

I then repeated and typed passw and the note was located.

Hi.  If that's correct,  it should not have happened...

https://help.evernote.com/hc/en-us/articles/208313828

https://dev.evernote.com/doc/articles/search_grammar.php

- Search will (should) only return hits from the beginning of a string.  "htpass*" should get your notes,  where "pass*" will not.

Share this post


Link to post
28 minutes ago, gazumped said:

Hi.  If that's correct,  it should not have happened...

- Search will (should) only return hits from the beginning of a string.  "htpass*" should get your notes,  where "pass*" will not.

Yes, I think I had come to understand that.  When I delve into the search results of course the word 'password' appears in the text so, of course 'passw' is at the beginning of the text.

However, as the screen capture shows, search for 'passw' causes it to be highlighted through the text in the middle as well as at the beginning of strings of text.

Andrew

screen capture.jpg

Share this post


Link to post

Well....  golly.  Didn't realise that was possible!  One of those exceptions that proves something or other I guess...  :wacko:

Share this post


Link to post

OK, two separate things happening here:

  1. The the note contains the words "password" (beginning with "p"), so the search term "passw" does match, and therefore the note is added to the list of matching notes. This is in accord with the standard Evernote search rules ( see https://dev.evernote.com/doc/articles/search_grammar.php), where literal terms match against the start of words identified in the note. If no word beginning with "passw" appeared in the note, then it would not match. Note that a search term of "passwd" wouldn't work, because that does not appear as a word in the text; it only appears after "ht".
  2. Separately, given the set of notes that match the search, inside the current note, the Windows client looks for occurrences of the term "passw" are found wherever they occur, even if they're in the middle of the word. This presumably uses the same mechanism as the Find function (Ctrl+F), a different mechanism that's used to match notes when doing an Evernote search.

 

Share this post


Link to post

Thanks all for the insights.  I have a better handle on searching and finding now.

Even so, I find it strange that using SEARCH locates the notes strictly according to the search algorithm, then performs a FIND inside each of the notes that are located through the SEARCH, but doesn't return the results of that FIND in the search.

But that's the way it is. 

Personally I'd find search more useful if it found all occurrences of the searched for string or if there were the option to use wildcards in the search.

Andrew

Share this post


Link to post
14 hours ago, agsteele said:

Even so, I find it strange that using SEARCH locates the notes strictly according to the search algorithm, then performs a FIND inside each of the notes that are located through the SEARCH, but doesn't return the results of that FIND in the search.

Two different search engines, confusing, but what it is.

Share this post


Link to post
2 hours ago, CalS said:

Two different search engines, confusing, but what it is.

Agreed. I mean I understand that they need a fast search for note filtering, and by limiting things to prefix-only searching, I think that they can build an index to make that work reasonably on the desktop while the user is typing in characters (at least for many cases). But it would be nice if the local clients could recognize, say, a prefix wildcard (e.g. '*abc') in the note filter to find infix text matches, and use to a slower search for those cases (but use the faster search .by default).

It all sounds so easy when you're not writing the code... :) 

  • Like 2

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

×