With R5, all you have to do is include computed-for-display fields for either Hits or TotalHits (or both) and Domino populates it with the correct value. Hits returns the number of documents found, and TotalHits returns the total number of instances the search string was found