IndexType
This enum selects the index algorithm. Pass an IndexType value to IndexParam when calling CreateIndexRequest, or to IndexDesc in responses. The valid choices depend on the field’s data type.
pub enum IndexType {
Invalid,
Flat,
IvfFlat,
IvfSq8,
IvfPq,
Hnsw,
HnswSq,
HnswPq,
HnswPrq,
DiskAnn,
AutoIndex,
Scann,
IvfRabitq,
Aisaq,
GpuIvfFlat,
GpuIvfPq,
GpuBruteForce,
GpuCagra,
BinFlat,
BinIvfFlat,
MinhashLsh,
Trie,
Ngram,
Rtree,
StlSort,
Inverted,
Bitmap,
SparseInvertedIndex,
SparseWand,
}
VARIANTS:
InvalidUnspecified or invalid index type. This is the default.
FlatBrute-force exact search; no index structure is built.
IvfFlatInverted-file index with flat storage of vectors in each cluster.
IvfSq8IVF index with scalar-quantized vector storage.
IvfPqIVF index with product-quantized vector storage.
HnswHierarchical navigable small-world graph index for ANN search.
HnswSqHNSW index with scalar-quantized vector storage.
HnswPqHNSW index with product-quantized vector storage.
HnswPrqHNSW index with product residual quantization (PQ + RQ).
DiskAnnDisk-based ANN index that keeps most of the graph on disk.
AutoIndexLets the server choose an appropriate index automatically.
ScannScan index using anisotropic vector quantization with re-ranking.
IvfRabitqIVF index with range-approximation binary quantization.
AisaqAdaptive index for high-recall ANN search on disk.
GpuIvfFlatGPU-accelerated IVF flat index.
GpuIvfPqGPU-accelerated IVF product-quantization index.
GpuBruteForceGPU brute-force exact search.
GpuCagraGPU-accelerated CAGRA graph index.
BinFlatExact search index for binary vectors.
BinIvfFlatIVF index for binary vectors.
MinhashLshMinHash LSH index for set similarity search.
TrieTrie index used for string filtering.
NgramN-gram index used for string matching.
RtreeR-tree index used for spatial queries.
StlSortSorted-list index over scalar values.
InvertedInverted index over scalar values for efficient filtering.
BitmapBitmap index over scalar values for efficient filtering.
SparseInvertedIndexInverted index over sparse vector dimensions.
SparseWandSparse-WAND index for sparse-vector ranking. Deprecated since Milvus 2.5.4; use
inverted_index_algo: DAAT_WANDonSparseInvertedIndexinstead.
Example
let index = IndexParam::new()
.field_name("embedding")
.index_type(IndexType::Hnsw)
.metric_type(MetricType::Cosine)
.extra_params(HashMap::from([("M".to_owned(), "16".to_owned())]));