Uses of Interface
org.apache.lucene.search.KnnCollector
Package
Description
Codecs API: API for customization of the encoding and structure of the index.
Lucene 9.9 file format.
Postings format that can delegate to different formats per-field.
Code to maintain and access indices.
Code to search indices.
Classes related to vector search: knn and vector fields.
Navigable Small-World graph, nominally Hierarchical but currently only has a single layer.
-
Uses of KnnCollector in org.apache.lucene.codecs
Modifier and TypeMethodDescriptionabstract void
KnnVectorsReader.search
(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) Return the k nearest neighbor documents as determined by comparison of their vector values for this field, to the given vector, by the field's similarity function.abstract void
KnnVectorsReader.search
(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) Return the k nearest neighbor documents as determined by comparison of their vector values for this field, to the given vector, by the field's similarity function. -
Uses of KnnCollector in org.apache.lucene.codecs.lucene99
Modifier and TypeMethodDescriptionvoid
Lucene99HnswVectorsReader.search
(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) void
Lucene99HnswVectorsReader.search
(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) -
Uses of KnnCollector in org.apache.lucene.codecs.perfield
Modifier and TypeMethodDescriptionvoid
PerFieldKnnVectorsFormat.FieldsReader.search
(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) void
PerFieldKnnVectorsFormat.FieldsReader.search
(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) -
Uses of KnnCollector in org.apache.lucene.index
Modifier and TypeMethodDescriptionfinal void
CodecReader.searchNearestVectors
(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) final void
CodecReader.searchNearestVectors
(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) void
ExitableDirectoryReader.ExitableFilterAtomicReader.searchNearestVectors
(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) void
ExitableDirectoryReader.ExitableFilterAtomicReader.searchNearestVectors
(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) void
FilterLeafReader.searchNearestVectors
(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) void
FilterLeafReader.searchNearestVectors
(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) abstract void
LeafReader.searchNearestVectors
(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) Return the k nearest neighbor documents as determined by comparison of their vector values for this field, to the given vector, by the field's similarity function.abstract void
LeafReader.searchNearestVectors
(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) Return the k nearest neighbor documents as determined by comparison of their vector values for this field, to the given vector, by the field's similarity function.void
ParallelLeafReader.searchNearestVectors
(String fieldName, byte[] target, KnnCollector knnCollector, Bits acceptDocs) void
ParallelLeafReader.searchNearestVectors
(String fieldName, float[] target, KnnCollector knnCollector, Bits acceptDocs) -
Uses of KnnCollector in org.apache.lucene.search
Modifier and TypeClassDescriptionclass
AbstractKnnCollector is the default implementation for a knn collector used for gathering kNN results and providing topDocs from the gathered neighborsclass
TopKnnCollector is a specific KnnCollector.Modifier and TypeMethodDescriptionTimeLimitingKnnCollectorManager.newCollector
(int visitedLimit, LeafReaderContext context) -
Uses of KnnCollector in org.apache.lucene.search.knn
Modifier and TypeClassDescriptionfinal class
MultiLeafKnnCollector is a specific KnnCollector that can exchange the top collected results across segments through a shared global queue.Modifier and TypeMethodDescriptionKnnCollectorManager.newCollector
(int visitedLimit, LeafReaderContext context) Return a newKnnCollector
instance.TopKnnCollectorManager.newCollector
(int visitedLimit, LeafReaderContext context) Return a newTopKnnCollector
instance. -
Uses of KnnCollector in org.apache.lucene.util.hnsw
Modifier and TypeClassDescriptionstatic final class
A restricted, specialized knnCollector that can be used when building a graph.final class
Wraps a provided KnnCollector object, translating the provided vectorId ordinal to a documentIdModifier and TypeMethodDescriptionstatic KnnCollector
HnswGraphSearcher.search
(RandomVectorScorer scorer, int topK, OnHeapHnswGraph graph, Bits acceptOrds, int visitedLimit) SearchOnHeapHnswGraph
, this method is thread safe.Modifier and TypeMethodDescriptionstatic void
HnswGraphSearcher.search
(RandomVectorScorer scorer, KnnCollector knnCollector, HnswGraph graph, Bits acceptOrds) Searches HNSW graph for the nearest neighbors of a query vector.ModifierConstructorDescriptionOrdinalTranslatedKnnCollector
(KnnCollector in, IntToIntFunction vectorOrdinalToDocId)