Milvus index creation and management.
Milvus requires explicit index creation on vector fields before search. Supports IVF_FLAT, HNSW, DISKANN, and other index types with configurable distance metrics.
Key difference from Chroma: Chroma auto-indexes. Milvus needs explicit index creation with type and metric selection.
Milvus index creation and management. Milvus requires explicit index creation on vector fields before search. Supports IVF_FLAT, HNSW, DISKANN, and other index types with configurable distance metrics. Key difference from Chroma: Chroma auto-indexes. Milvus needs explicit index creation with type and metric selection.
(->index-type it)Resolve keyword or IndexType to IndexType enum.
Resolve keyword or IndexType to IndexType enum.
(->metric-type mt)Resolve keyword or MetricType to MetricType enum.
Resolve keyword or MetricType to MetricType enum.
(create-index-param {:keys [collection-name field-name index-type metric-type
index-name extra-params]})Build a CreateIndexParam from a Clojure map.
Required keys:
:collection-name - target collection
:field-name - field to index (usually the vector field)
:index-type - keyword from index-types (e.g. :hnsw, :ivf-flat)
:metric-type - keyword from metric-types (e.g. :cosine, :l2, :ip)
Optional keys: :index-name - custom index name :extra-params - map of index-specific params IVF: {:nlist 1024} HNSW: {:M 16 :efConstruction 256}
Example: (create-index-param {:collection-name "memories" :field-name "embedding" :index-type :hnsw :metric-type :cosine :extra-params {:M 16 :efConstruction 256}})
Build a CreateIndexParam from a Clojure map.
Required keys:
:collection-name - target collection
:field-name - field to index (usually the vector field)
:index-type - keyword from `index-types` (e.g. :hnsw, :ivf-flat)
:metric-type - keyword from `metric-types` (e.g. :cosine, :l2, :ip)
Optional keys:
:index-name - custom index name
:extra-params - map of index-specific params
IVF: {:nlist 1024}
HNSW: {:M 16 :efConstruction 256}
Example:
(create-index-param
{:collection-name "memories"
:field-name "embedding"
:index-type :hnsw
:metric-type :cosine
:extra-params {:M 16 :efConstruction 256}})Default index configuration for the memory embedding field. HNSW with cosine similarity — good balance of speed and recall.
HNSW params: M=16 — connections per node (higher = better recall, more memory) efConstruction=256 — build-time search width (higher = better recall, slower build)
Default index configuration for the memory embedding field. HNSW with cosine similarity — good balance of speed and recall. HNSW params: M=16 — connections per node (higher = better recall, more memory) efConstruction=256 — build-time search width (higher = better recall, slower build)
(describe-index-param collection-name field-name)Build a DescribeIndexParam for inspecting an existing index.
Build a DescribeIndexParam for inspecting an existing index.
(drop-index-param collection-name field-name)Build a DropIndexParam for removing an index.
Build a DropIndexParam for removing an index.
Mapping of keywords to Milvus IndexType enum values.
Common choices: :hnsw — Best recall, higher memory. Good for <10M vectors. :ivf-flat — Good balance. Works with partitions. :diskann — Disk-based. Best for >100M vectors. :autoindex — Let Milvus choose (cloud/managed).
Mapping of keywords to Milvus IndexType enum values. Common choices: :hnsw — Best recall, higher memory. Good for <10M vectors. :ivf-flat — Good balance. Works with partitions. :diskann — Disk-based. Best for >100M vectors. :autoindex — Let Milvus choose (cloud/managed).
Mapping of keywords to Milvus MetricType enum values.
:cosine — Cosine similarity (normalized). Default for embeddings. :l2 — Euclidean distance. Lower = more similar. :ip — Inner product. Higher = more similar.
Mapping of keywords to Milvus MetricType enum values. :cosine — Cosine similarity (normalized). Default for embeddings. :l2 — Euclidean distance. Lower = more similar. :ip — Inner product. Higher = more similar.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |