As Stefan mentioned in his comment .getRowCount()
refers to the rows visible on the page. From what I get you're interested in the entries of the view rather than the rows shown by the redering component.
One option that comes to my mind would be to access the viewEntryCollection
object through the Domino view in question and then get the entry count from that:
var vw=database.getView("dvwContent");
var filter=["someFilter"];
var vec=vw.getAllEntriesByKey(filter, true);
return vec.getCount().toString() + " documents have been found";