public class VectorIndexParams extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VectorIndexParams.Builder |
| Modifier and Type | Method and Description |
|---|---|
DistanceType |
getDistanceType() |
Optional<HnswBuildParams> |
getHnswParams() |
IvfBuildParams |
getIvfParams() |
Optional<PQBuildParams> |
getPqParams() |
Optional<SQBuildParams> |
getSqParams() |
static VectorIndexParams |
ivfFlat(int numPartitions,
DistanceType distanceType)
Create a new IVF index with flat quantizer.
|
static VectorIndexParams |
ivfPq(int numPartitions,
int numBits,
int numSubVectors,
DistanceType distanceType,
int maxIterations)
Create a new IVF index with PQ quantizer.
|
String |
toString() |
static VectorIndexParams |
withIvfHnswPqParams(DistanceType distanceType,
IvfBuildParams ivf,
HnswBuildParams hnsw,
PQBuildParams pq)
Create a new IVF HNSW index with PQ quantizer.
|
static VectorIndexParams |
withIvfHnswSqParams(DistanceType distanceType,
IvfBuildParams ivf,
HnswBuildParams hnsw,
SQBuildParams sq)
Create a new IVF HNSW index with SQ quantizer.
|
static VectorIndexParams |
withIvfPqParams(DistanceType distanceType,
IvfBuildParams ivf,
PQBuildParams pq)
Create a new IVF index with PQ quantizer.
|
public static VectorIndexParams ivfFlat(int numPartitions, DistanceType distanceType)
numPartitions - the number of partitions of IVF (Inverted File Index)distanceType - the distance type for calculating the distance between vectorspublic static VectorIndexParams ivfPq(int numPartitions, int numBits, int numSubVectors, DistanceType distanceType, int maxIterations)
numPartitions - the number of partitions of IVF (Inverted File Index)numBits - maps the float vectors to integer vectors, each integer is of num_bits. Now only
8 bits are supportednumSubVectors - the number of sub-vectors for PQ (Product Quantization)distanceType - the distance type for calculating the distance between vectorsmaxIterations - K-means max iterations. This will run k-means clustering on each subvector
to determine the centroids that will be used to quantize the subvectors.public static VectorIndexParams withIvfPqParams(DistanceType distanceType, IvfBuildParams ivf, PQBuildParams pq)
distanceType - the distance type for calculating the distance between vectorsivf - the IVF build parameterspq - the PQ build parameterspublic static VectorIndexParams withIvfHnswPqParams(DistanceType distanceType, IvfBuildParams ivf, HnswBuildParams hnsw, PQBuildParams pq)
distanceType - the distance type for calculating the distance between vectorsivf - the IVF build parametershnsw - the HNSW build parameterspq - the PQ build parameterspublic static VectorIndexParams withIvfHnswSqParams(DistanceType distanceType, IvfBuildParams ivf, HnswBuildParams hnsw, SQBuildParams sq)
distanceType - the distance type for calculating the distance between vectorsivf - the IVF build parametershnsw - the HNSW build parameterssq - the SQ build parameterspublic DistanceType getDistanceType()
public IvfBuildParams getIvfParams()
public Optional<PQBuildParams> getPqParams()
public Optional<HnswBuildParams> getHnswParams()
public Optional<SQBuildParams> getSqParams()
Copyright © 2025. All rights reserved.