Package org.apache.lucene.search

# Class TimeLimitingKnnCollectorManager

java.lang.Object
org.apache.lucene.search.TimeLimitingKnnCollectorManager

All Implemented Interfaces:
  `KnnCollectorManager`

public class TimeLimitingKnnCollectorManager extends Object implements KnnCollectorManager
A `KnnCollectorManager` that collects results with a timeout.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TimeLimitingKnnCollectorManager(KnnCollectorManager delegate, QueryTimeout timeout)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `QueryTimeout`
  `getQueryTimeout()`
  Get the configured `QueryTimeout` for terminating graph and exact searches.
  `KnnCollector`
  `newCollector(int visitedLimit, KnnSearchStrategy searchStrategy, LeafReaderContext context)`
  Return a new `KnnCollector` instance.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.lucene.search.knn.KnnCollectorManager

  `isOptimistic, newOptimisticCollector`

- ## Constructor Details

  - ### TimeLimitingKnnCollectorManager

    public TimeLimitingKnnCollectorManager(KnnCollectorManager delegate, QueryTimeout timeout)

- ## Method Details

  - ### getQueryTimeout

    public QueryTimeout getQueryTimeout()
    Get the configured `QueryTimeout` for terminating graph and exact searches.

  - ### newCollector

    public KnnCollector newCollector(int visitedLimit, KnnSearchStrategy searchStrategy, LeafReaderContext context) throws IOException
    Description copied from interface: `KnnCollectorManager`
    Return a new `KnnCollector` instance.
    Specified by:
      `newCollector` in interface `KnnCollectorManager`
    Parameters:
      `visitedLimit` - the maximum number of nodes that the search is allowed to visit
      `searchStrategy` - the optional search strategy configuration
      `context` - the leaf reader context
    Throws:
      `IOException`