Use TopFieldDocs.TotalHits (minus skipped results) instead of TopFieldDocs.ScoreDocs.Length for performance.