You could run the cursor you get from SearchQuery.getCursor over the document and count matches.
SearchQuery.getCursor