Package org.apache.lucene.search.knn
Class TopKnnCollectorManager
java.lang.Object
org.apache.lucene.search.knn.TopKnnCollectorManager
- All Implemented Interfaces:
KnnCollectorManager
TopKnnCollectorManager responsible for creating
TopKnnCollector instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleannewCollector(int visitedLimit, KnnSearchStrategy searchStrategy, LeafReaderContext context) Return a newTopKnnCollectorinstance.newOptimisticCollector(int visitedLimit, KnnSearchStrategy searchStrategy, LeafReaderContext context, int k) Return a newKnnCollectorinstance, generally with a specific k value, scaled per leaf statistics
-
Constructor Details
-
TopKnnCollectorManager
-
-
Method Details
-
newCollector
public KnnCollector newCollector(int visitedLimit, KnnSearchStrategy searchStrategy, LeafReaderContext context) throws IOException Return a newTopKnnCollectorinstance.- Specified by:
newCollectorin interfaceKnnCollectorManager- Parameters:
visitedLimit- the maximum number of nodes that the search is allowed to visitsearchStrategy- the optional search strategy configurationcontext- the leaf reader context- Throws:
IOException
-
newOptimisticCollector
public KnnCollector newOptimisticCollector(int visitedLimit, KnnSearchStrategy searchStrategy, LeafReaderContext context, int k) Description copied from interface:KnnCollectorManagerReturn a newKnnCollectorinstance, generally with a specific k value, scaled per leaf statistics- Specified by:
newOptimisticCollectorin interfaceKnnCollectorManager- Parameters:
visitedLimit- the maximum number of nodes that the search is allowed to visitsearchStrategy- the optional search strategy configurationcontext- the leaf reader contextk- the number of neighbors to collect, this is the expected number of results- Returns:
- a new KnnCollector instance
-
isOptimistic
public boolean isOptimistic()- Specified by:
isOptimisticin interfaceKnnCollectorManager
-