I'm not sure if I can word this clearly enough but I'll try, LOL.
The only thing that I can see that has a "hasNotes" field that is remotely close, is the Document itself. This means it would only work for the first version and if you stack a new file version on top, it would still show that it "has notes", because the old version had notes.
If you don't stack versions of a document, this might work for you? if so, just respond in post and I or someone else would help you with the code.