KnnSearchStrategy (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.search.knn, class: KnnSearchStrategy

Package org.apache.lucene.search.knn

# Class KnnSearchStrategy

java.lang.Object
org.apache.lucene.search.knn.KnnSearchStrategy

Direct Known Subclasses:
  `KnnSearchStrategy.Hnsw`, `KnnSearchStrategy.Seeded`

public abstract class KnnSearchStrategy extends Object
KnnSearchStrategy is a strategy for kNN search, providing additional search strategy configuration

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `KnnSearchStrategy.Hnsw`
  A strategy for kNN search that uses HNSW
  `static class`
  `KnnSearchStrategy.Patience`
  A strategy for kNN search on HNSW that early exits when nearest neighbor collection rate saturates.
  `static class`
  `KnnSearchStrategy.Seeded`
  A strategy for kNN search that uses a set of entry points to start the search

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_FILTERED_SEARCH_THRESHOLD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `KnnSearchStrategy()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract boolean`
  `equals(Object obj)`
  Override and implement search strategy instance equivalence properly in a subclass.
  `abstract int`
  `hashCode()`
  Override and implement search strategy hash code properly in a subclass.
  `abstract void`
  `nextVectorsBlock()`
  Signal processing of the next block of vectors.

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

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

- ## Field Details

  - ### DEFAULT_FILTERED_SEARCH_THRESHOLD

    public static final int DEFAULT_FILTERED_SEARCH_THRESHOLD
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### KnnSearchStrategy

    public KnnSearchStrategy()

- ## Method Details

  - ### equals

    public abstract boolean equals(Object obj)
    Override and implement search strategy instance equivalence properly in a subclass.
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public abstract int hashCode()
    Override and implement search strategy hash code properly in a subclass.
    Overrides:
      `hashCode` in class `Object`
    See Also:
      - `equals(Object)`

  - ### nextVectorsBlock

    public abstract void nextVectorsBlock()
    Signal processing of the next block of vectors.