public static class HybridVectorArgs.Knn extends Object implements HybridVectorArgs.VectorSearchMethod
Finds the K most similar vectors to the query vector. This is the default and most common vector search method.
| Modifier and Type | Method and Description |
|---|---|
<K,V> void |
build(CommandArgs<K,V> args)
Build the method arguments into the command.
|
HybridVectorArgs.Knn |
efRuntime(int efRuntime)
Set the EF_RUNTIME parameter for HNSW search.
|
static HybridVectorArgs.Knn |
of(int k)
Static factory method to create a KNN search method.
|
public static HybridVectorArgs.Knn of(int k)
k - number of nearest neighbors to returnpublic HybridVectorArgs.Knn efRuntime(int efRuntime)
The EF_RUNTIME parameter controls the size of the dynamic candidate list during HNSW search. Higher values improve recall but increase search time.
efRuntime - size of the dynamic candidate list for HNSW algorithmpublic <K,V> void build(CommandArgs<K,V> args)
HybridVectorArgs.VectorSearchMethodbuild in interface HybridVectorArgs.VectorSearchMethodK - key typeV - value typeargs - command argumentsCopyright © 2026 lettuce.io. All rights reserved.