public enum QuantizationType extends Enum<QuantizationType>
Quantization affects how vectors are stored and impacts memory usage, performance, and recall quality. Different quantization types offer different trade-offs between memory usage, search speed, and accuracy.
| Enum Constant and Description |
|---|
BINARY
Binary quantization.
|
NO_QUANTIZATION
No quantization.
|
Q8
Signed 8-bit quantization.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getKeyword()
Gets the command keyword string used in Redis commands for this quantization type.
|
static QuantizationType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static QuantizationType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final QuantizationType NO_QUANTIZATION
This provides the highest precision but uses the most memory (4 bytes per dimension). Use this when precision is critical and memory usage is not a concern.
Corresponds to the NOQUANT option in Redis commands.
public static final QuantizationType BINARY
This is the most memory-efficient option (1 bit per dimension) and provides the fastest search, but has the lowest recall quality. Use this when memory usage and speed are critical, and some loss in recall quality is acceptable.
Corresponds to the BIN option in Redis commands.
public static final QuantizationType Q8
This is the default quantization type and provides a good balance between memory usage (1 byte per dimension) and recall quality. Use this for most use cases.
Corresponds to the Q8 option in Redis commands.
public static QuantizationType[] values()
for (QuantizationType c : QuantizationType.values()) System.out.println(c);
public static QuantizationType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getKeyword()
Copyright © 2025 lettuce.io. All rights reserved.