topDocs

abstract fun topDocs(): TopDocs

This drains the collected nearest kNN results and returns them in a new TopDocs collection, ordered by score descending. NOTE: This is generally a destructive action and the collector should not be used after topDocs() is called.

Return

The collected top documents