Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I list notes from EvernoteNoteStoreClient.findNotes()?. When the notefilter is empty I am able to list all notebooks

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".

like image 447
Gokula Krishnan Avatar asked Nov 07 '22 13:11

Gokula Krishnan


1 Answers

I am using the Evernote Python API and had a similar issue.

  1. If you provide more than one Evernote tag GUIDs the search will be performed using AND logic. Matching notes have to contain all tags.

  2. 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)
    
like image 50
Daniel Avatar answered Nov 14 '22 21:11

Daniel