stevebu 0 Posted March 18, 2022 Share Posted March 18, 2022 I’m trying to search for phrases in a single note. This has to be a simple answer, but I only get single words in my results. I’m running the latest Evernote updates on a Mac. I’ve tried putting parentheses around a phrase in the search bar, but it doesn’t return any result. I would appreciate your feedback. Thank you! Link to comment
Level 5 Solution PinkElephant 8,746 Posted March 18, 2022 Level 5 Solution Share Posted March 18, 2022 The simple answer is: You can’t search for an exact match of a whole sentence. The reason behind it is how the search index is build. EN explains it in a document about the advanced search grammar, but in short they convert the text in a document into a list of words. The sentence is not searchable, because it does not exist in the search index. But you can use the key words from your sentence (skipping words like And, The, It and so on), and it should find the sentence. Here is the relevant passage from the grammar description ( https://dev.evernote.com/doc/articles/search_grammar.php) : The behavior of a quoted search should behave as if the following operations were performed on both the search query and the target note: All XML markup is removed from the document, leaving only the visible text as a string The string is converted to a list of words which are separated by one or more whitespace and/or punctuation characters. The case of each word in the list is normalized The list of words in the query must match with the same sequence of words in the converted Note For example, if a user searches for the phrase "Spatula! City! For Bargains..." against this ENML document: The algorithm should convert the search phrase into a normalized list of words: [ "spatula", "city", "for", "bargains" ] And the document into: [ "come", "down", "to", "spatula", "city", "for", "bargains", "on", "spatulas" ] The search should match, since words from the target phrase are found in the list of words extracted from the document. (The same result could be implemented without literally converting each note into a list of words, but this gives the intended behavior that we see from major search engines like Google and MS.) 1 Link to comment
eric99 1,077 Posted March 18, 2022 Share Posted March 18, 2022 31 minutes ago, PinkElephant said: The simple answer is: You can’t search for an exact match of a whole sentence. A small test reveals that you can search for an exact match by connecting the words with a minus sign, for example: this-is-a-test 1 Link to comment
stevebu 0 Posted March 18, 2022 Author Share Posted March 18, 2022 I really appreciate the thorough explanation from Pink Elephant! Your information will be very helpful. I'm very surprised Evernote doesn't provide an easy solution for searching phrases. I would think this would be beneficial and a huge time saver for everyone. Thanks again, Steve Link to comment
Level 5 PinkElephant 8,746 Posted March 18, 2022 Level 5 Share Posted March 18, 2022 Well, in fact EN search is existing since quite a while. Computing power and disk space was much more expensive then than they are today. The way it is constructed it is saving a lot of space, and makes for a fast search. Usually a word will show up several times in a document, especially when case normalized (which means only the word core is stored, without differing endings). The word will show only once, and then a list of spots where the word shows up, with their location. It is obvious this is much leaner than an index that as well lists which word stands close to which other - in that case every combination needs to be saved. Words are repetitive - combinations like in a sentence are much less so. This means the index would be bloated, just to allow this one specific search case. I think they took a decision to go for the simpler index, and write a support text about what works, and what doesn’t. Link to comment
eric99 1,077 Posted March 18, 2022 Share Posted March 18, 2022 30 minutes ago, stevebu said: I really appreciate the thorough explanation from Pink Elephant! Your information will be very helpful. I'm very surprised Evernote doesn't provide an easy solution for searching phrases. I would think this would be beneficial and a huge time saver for everyone. Thanks again, Steve As I tried to explain, EN does provide a solution for searching phrases, just concatenate the words in the search string with a minus sign, Search string example: this-is-a-test This will find the string: "this is a test" but not "this xxx is a test" 1 Link to comment
Level 5 PinkElephant 8,746 Posted March 18, 2022 Level 5 Share Posted March 18, 2022 Cool, it works ! It even works if there is interpunctation in the original string, not typed into the search term. Did you find it documented anywhere, or is it a dark hack ? Link to comment
eric99 1,077 Posted March 19, 2022 Share Posted March 19, 2022 7 hours ago, PinkElephant said: Cool, it works ! It even works if there is interpunctation in the original string, not typed into the search term. Did you find it documented anywhere, or is it a dark hack ? I was inspired by this. EN did a perfect job to make it work in the search string as well 🙂 1 1 Link to comment
Mike P 2,961 Posted March 19, 2022 Share Posted March 19, 2022 The perhaps more conventional approach of enclosing the phrase in quotation marks also seems to work and gives me identical results to the "hyphen method". 1 Link to comment
eric99 1,077 Posted March 19, 2022 Share Posted March 19, 2022 1 hour ago, Mike P said: The perhaps more conventional approach of enclosing the phrase in quotation marks also seems to work and gives me identical results to the "hyphen method". You're right, I tried it myself and it seems to work indeed! I think we misunderstood the original question: it's probably a search problem in a note, not the database search. Quotes are impossible in a note search indeed. But I still don't understand the problem because the note search always searches for an exact match of the whole search string, no quotes required... 1 Link to comment
Mike P 2,961 Posted March 19, 2022 Share Posted March 19, 2022 20 minutes ago, eric99 said: You're right, I tried it myself and it seems to work indeed! I think we misunderstood the original question: it's probably a search problem in a note, not the database search. Quotes are impossible in a note search indeed... Looking again at the original post I think you are right. However just typing the phrase (no quotation marks or hypens) seems to work fine for me. For example searching for data in this note gives me 12 results: Searching for common data gives me just one result as expected. Link to comment
eric99 1,077 Posted March 19, 2022 Share Posted March 19, 2022 34 minutes ago, Mike P said: Looking again at the original post I think you are right. However just typing the phrase (no quotation marks or hypens) seems to work fine for me. For example searching for data in this note gives me 12 results: Searching for common data gives me just one result as expected. yeah, I already added that to my message in the mean time 🙂 But then is there any problem at all? Link to comment
helcat 1 Posted January 15, 2023 Share Posted January 15, 2023 On 3/18/2022 at 5:31 PM, eric99 said: A small test reveals that you can search for an exact match by connecting the words with a minus sign, for example: this-is-a-test Thank you! This worked for me. 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now