Jump to content

(Archived) Hyphenated searches are broken


ThatAdamGuy

Recommended Posts

Posted

Searches for my friend Ting-Yu failed to bring up the relevant notes.

Instead, Evernote searched for Ting NOT Yu.  Oops :o

Posted

Searches for my friend Ting-Yu failed to bring up the relevant notes.

Instead, Evernote searched for Ting NOT Yu.  Oops :o

 

This is not broken.  Instead, it's the way the EN search works & is expected behaviour.  Words are letters, numbers & the underscore.  Everything else is a delimter.  In the search bar, -YU is indeed looking for notes that do not contain "yu".  You could try enclosing it in quotes "Ting-Yu" but I'm not sure that works correctly all the time.

Posted

I'd have expected delimiters to be preceded by white space. Hyphenated words are not uncommon and should be taken into account, no?

Posted

I'd have expected delimiters to be preceded by white space. Hyphenated words are not uncommon and should be taken into account, no?

If a delimiter is preceded by a white space, then it's not a delimiter; the white space is. ;-)

I would imagine EN folks took this into consideration, since, as you say, hyphenated words are not uncommon. OTOH, if enclosing in quotes (as I mentioned above) doesn't work, you can search on both parts of the word, enclosed in quotes like:

"ting "yu"

This will cause the search engine to look only for those words & not include words such as 'tingle'.

  • Level 5*
Posted

I'd have expected delimiters to be preceded by white space. Hyphenated words are not uncommon and should be taken into account, no?

The search grammar doc (http://dev.evernote.com/documentation/cloud/chapters/search_grammar.php) says otherwise, I think. Literal words (as distinct from quoted literals) in the search query must consit only of "wordchar"s ("any Unicode Letter or Number (Unicode character classes L and N) or underscore '_')". So the parser looks at the search Ting-Yu and reads wordchars up to the '-'. Since '-' not a wordchar, parsing pauses, and "Ting" is set aside as a literal search term. Parsing then continues with the as-yet unhandled '-'. That's a match for the first part of one of the definitions of "term", and it means "negate what follows". What follows is "Yu", so we wind up with a search for notes that contain "Ting" but do not contain "Yu". Quoting Ting-Yu ("Ting-Yu") makes it produce the desired result.

  • 11 months later...
Posted

I'd have expected delimiters to be preceded by white space. Hyphenated words are not uncommon and should be taken into account, no?

If a delimiter is preceded by a white space, then it's not a delimiter; the white space is. ;-)

Technically correct, but what I believe the poster meant is that he would expect operators such as "-" to be delimited by a space, and when they are not, to be treated as part of the string.

Archived

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

×
×
  • Create New...