AbstractKnnCollector

AbstractKnnCollector is the default implementation for a knn collector used for gathering kNN results and providing topDocs from the gathered neighbors

Inheritors

Properties

Link copied to clipboard
open override val searchStrategy: KnnSearchStrategy?

Functions

Link copied to clipboard
abstract override fun collect(docId: Int, similarity: Float): Boolean

Collect the provided docId and include in the result set.

Link copied to clipboard
open override fun earlyTerminated(): Boolean

If search visits too many documents, the results collector will terminate early. Usually, this is due to some restricted filter on the document set.

Link copied to clipboard
open override fun incVisitedCount(count: Int)
Link copied to clipboard
open override fun k(): Int
Link copied to clipboard
abstract override fun minCompetitiveSimilarity(): Float

This method is utilized during search to ensure only competitive results are explored.

Link copied to clipboard
abstract fun numCollected(): Int
Link copied to clipboard
abstract override 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.

Link copied to clipboard
open override fun visitedCount(): Long
Link copied to clipboard
open override fun visitLimit(): Long