KnnCollector

interface KnnCollector

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

Inheritors

Types

Link copied to clipboard
open class Decorator(collector: KnnCollector) : KnnCollector

KnnCollector.Decorator is the base class for decorators of KnnCollector objects, which extend the object with new behaviors.

Properties

Link copied to clipboard

Functions

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

Collect the provided docId and include in the result set.

Link copied to clipboard
abstract 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
abstract fun incVisitedCount(count: Int)
Link copied to clipboard
abstract fun k(): Int
Link copied to clipboard

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

Link copied to clipboard
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.

Link copied to clipboard
abstract fun visitedCount(): Long
Link copied to clipboard
abstract fun visitLimit(): Long