I am using the Evernote API to create an Android app. I am trying to list notes based on tags. but when I add filters my note list is empty, and when I do not add any filter I am able to list all the notes. While there are filters I don't get any notes
EvernoteNoteStoreClient evernoteNoteStoreClient = EvernoteSession.getInstance().getEvernoteClientFactory().getNoteStoreClient();
NoteFilter noteFilter = new NoteFilter();
noteFilter.setTagGuids(tags);//List of Tag GUIds
try{
NoteList notes = evernoteNoteStoreClient.findNotes(noteFilter,100,100);
Log.d("Evereee", "size is "+ String.valueOf(notes.getNotesSize()));
//I get 0 when noteFilter has tags
}catch (Exception e){
Toast.makeText(this, "Error Occured!", Toast.LENGTH_SHORT).show();
}
when I add GUID of a tag say "DOG", the size gives 0. Whereas it should show 3 because I created sample notes with tag "DOG".
I am using the Evernote Python API and had a similar issue.
If you provide more than one Evernote tag GUIDs the search will be performed using AND logic. Matching notes have to contain all tags.
I used findNotesMetadata instead of findNotes function (see also the Thrift documentation). Here is a working Python example snippet:
tag_filter = NoteFilter(tagGuids=[tagGuid_str])
result_spec = NotesMetadataResultSpec(includeTitle=True, includeTagGuids=True)
result_list = note_store.findNotesMetadata(tag_filter, offset, max_notes, result_spec)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With