I'm using Evernote's PHP SDK and I need to retrieve a list of tagged notes. When I filter by keyword or notebook giud it works, but as soon as I set tagGuids i get empty list.
Here's sample code:
$noteFilter=new EDAM\NoteStore\NoteFilter();
#For the sake of this example, I'm just getting all existing tags
#and adding them to filter so it should:
$tags=$noteStore->listTags($token);
$noteFilter->tagGuids=Array();
foreach($tags as $tag){
$noteFilter->tagGuids[]=$tag->guid;
}
$notes=$noteStore->findNotes($token,$noteFilter,0,20);
I have notes with tags. But this is what i get in result, an empty list:
EDAM\NoteStore\NoteList Object
(
[startIndex] => 0
[totalNotes] => 0
[notes] => Array
(
)
[stoppedWords] =>
[searchedWords] =>
[updateCount] => 139
)
Actually, you can't do this kind of search. Using the tagGuids property with - let's say - 2 tags will lead to search for notes containing these 2 tags at the same time. It's an 'AND' search, not an 'OR' search.
One option would be to make several searches, each with one tag and merging the results... Not optimal but I'm afraid it's the only solution you have.
You may find some help here : https://dev.evernote.com/doc/articles/search_grammar.php
BTW, the findNotes methods is deprecated. You should use the findNotesMetadata method :