Class KnnVectorQuery


@Deprecated public class KnnVectorQuery extends KnnFloatVectorQuery
Deprecated.
Uses KnnVectorsReader.search(String, float[], KnnCollector, Bits) to perform nearest neighbour search.

This query also allows for performing a kNN search subject to a filter. In this case, it first executes the filter for each leaf, then chooses a strategy dynamically:

  • If the filter cost is less than k, just execute an exact search
  • Otherwise run a kNN search subject to the filter
  • If the kNN search visits too many vectors without completing, stop and run an exact search
  • Constructor Details

    • KnnVectorQuery

      public KnnVectorQuery(String field, float[] target, int k)
      Deprecated.
    • KnnVectorQuery

      public KnnVectorQuery(String field, float[] target, int k, Query filter)
      Deprecated.