I'm not sure if it's quite what you're asking, but if I understand you correctly, what you want to do, is get the count of items that match your query [ count(id) or something similar ] and then only ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results