| Modifier and Type | Method and Description |
|---|---|
static VAddArgs |
attributes(String attributes)
Creates new
VAddArgs with the specified attributes (SETATTR). |
static VAddArgs |
checkAndSet(boolean checkAndSet)
Creates new
VAddArgs and sets the CAS flag. |
static VAddArgs |
explorationFactor(Long explorationFactor)
Creates new
VAddArgs and setting EF (exploration factor). |
static VAddArgs |
maxNodes(Long maxNodes)
Creates new
VAddArgs and setting M (maximum links). |
static VAddArgs |
quantizationType(QuantizationType quantType)
Creates new
VAddArgs and setting the quantization type. |
public static VAddArgs checkAndSet(boolean checkAndSet)
VAddArgs and sets the CAS flag.
The CAS option performs the operation partially using threads, in a check-and-set style. The neighbor candidates collection, which is slow, is performed in the background, while the command is executed in the main thread.
checkAndSet - whether to perform a check and set operation.VAddArgs with CAS set.VAddArgs.checkAndSet(boolean)public static VAddArgs quantizationType(QuantizationType quantType)
VAddArgs and setting the quantization type.
Quantization affects how vectors are stored and impacts memory usage, performance, and recall quality:
Q8 (default) - Uses signed 8-bit quantization, balancing memory usage and recall qualityNOQUANT - Stores vectors without quantization, using more memory but preserving full precisionBIN - Uses binary quantization, which is faster and uses less memory, but impacts recall qualityNote that these options are mutually exclusive.
quantType - the quantization type for the vector.VAddArgs with the quantization type set.VAddArgs.quantizationType(QuantizationType)public static VAddArgs explorationFactor(Long explorationFactor)
VAddArgs and setting EF (exploration factor).
The EF option plays a role in the effort made to find good candidates when connecting the new node to the existing Hierarchical Navigable Small World (HNSW) graph.
The default is 200. Using a larger value may help in achieving a better recall, but will increase the time needed to add vectors to the set.
explorationFactor - the exploration factor for the vector search (default: 200).VAddArgs with EF set.VAddArgs.explorationFactor(Long)public static VAddArgs maxNodes(Long maxNodes)
VAddArgs and setting M (maximum links).
The M option specifies the maximum number of connections that each node of the graph will have with other nodes.
The default is 16. More connections means more memory, but provides for more efficient graph exploration. Nodes at layer zero (every node exists at least at layer zero) have M * 2 connections, while the other layers only have M connections.
If you don't have a recall quality problem, the default is acceptable and uses a minimal amount of memory.
maxNodes - the maximum number of connections per node (default: 16).VAddArgs with M set.VAddArgs.maxNodes(Long)public static VAddArgs attributes(String attributes)
VAddArgs with the specified attributes (SETATTR).
The SETATTR option associates attributes in the form of a JavaScript object to the newly created entry or updates the attributes (if they already exist). It is the same as calling the VSETATTR command separately.
Attributes can be used for filtering during similarity searches with the VSIM command.
attributes - the attributes for the vector as JSON string.VAddArgs with the attributes set.VAddArgs.attributes(String)Copyright © 2025 lettuce.io. All rights reserved.