geeknote
geeknote copied to clipboard
Integrata FZF Fuzzy Note Search
Hi I am really keen to integrate something like FZF into the evernote note search. https://github.com/junegunn/fzf
Does anyone have any ideas about this, and how one might approach this.
Oscar
This idea, while interesting, isn't practical. Searches are actually performed on the server (evernote.com) side, not the client (geeknote) side. See https://dev.evernote.com/doc/articles/searching_notes.php. In order for a client side fuzzy search to work, we'd need to first pull all the data (be it note titles or note content or note resources) to the client side, which would overwhelm the API rate limiter.
Hey @jeffkowalski how does https://github.com/neilagabriel/vim-geeknote do it then? I would just do note titles only.
Hi @oscarmorrison,
Regrettably, I don't see any code to do fuzzy search in vim-geeknote, and I don't see it mentioned as a feature in the README.
Examining that code, what I do see in GeeknoteGetNotes is that a call is made to findNotesMetaData with the NoteFilter's words
set to the sought terms. Evernote, on the server end, is responsible for seeking the notes.
Tracking the calls up the tree, I see that the terms are simply given by the user, and the results are delivered directly to the explorer panel, so there doesn't seem to be any magic.
This scheme is the same implementation that's present in geeknote.
If you can find the place in the code that does fuzzy matching, I'd be very happy to take a look at it.
Sorry @jeffkowalski my message wasnt clear. I was more saying the vim-geeknote has a way to retrieve all the note titles in one hit pretty quick. (I guess thats the findNotesMetaData call)
I was more wondering how difficult you think this might be to use that call, then fzf to find the note from the list. Then have geeknote open it.
I love geeknote, but finding notes and such is a slow process for me.
I see what you're proposing. Thank you for explaining.
The right place for you to experiment would be in findNotes in geeknote.
There, you can set the count
to a large number like EDAM_USER_NOTES_MAX, words to "*", and retrieve all the notes, and then inspect their titles.
Doing this from the command line appears slow to the user because geeknote also persists the results in a database after the search, so that a subsequent command can reference those results by number.
Your proposal may still be unscalable though. I have 18K notes, for example. Would it work on larger note stores?
When you've got something working, I'd be happy to review a pull request.