Skip to Content
We are live but in Staging πŸŽ‰
CLI GuideCollections, Data & Index

Collections, Data & Index β€” Milvus-direct commands

The collection, index, data, and status commands operate on Milvus through your allocated database. They connect directly to the endpoint that dodil vbase db use wrote into your config β€” so run db use <service_id> first, or pass --db <name> per command.

These commands are convenience wrappers over standard Milvus operations. For the full Milvus data-plane surface β€” batch insert, filtered/hybrid search, partitions, queries β€” connect with the Milvus SDK against the same endpoint. See Recipes for end-to-end examples.

Every command below accepts --db <name> to target a database other than the active one, and -o json for machine-readable output.

Collections β€” dodil vbase collection

CommandMilvus op
collection create <name>CreateCollection
collection listShowCollections
collection show <name>DescribeCollection + DescribeIndex
collection load <name>LoadCollection
collection release <name>ReleaseCollection
collection drop <name>DropCollection

collection create

Two schema modes.

Default mode β€” a primary-key field plus one vector field, configured by flags:

dodil vbase collection create products \ --dim 768 \ --id-type varchar --id-max-length 128
FlagDefaultNotes
--dim8Vector dimension. Must be > 0.
--id-fieldidPrimary-key field name.
--id-typevarcharvarchar or int64.
--id-max-length64Max length for varchar ids.
--vector-fieldvectorVector field name.
--vector-typefloat_vectorfloat_vector or binary_vector.
--dynamic-fieldstrueEnable Milvus dynamic fields.

Custom schema mode β€” pass repeated --field specs in the form name:type[:pk][:key=value,...]. Exactly one field must be marked pk:

dodil vbase collection create products \ --field "doc_id:varchar:pk:max_length=64" \ --field "vector:float_vector:dim=768" \ --field "category:varchar:max_length=32"

Supported type values: bool, int8, int16, int32, int64, float, double, varchar, json, float_vector, binary_vector. Vector fields require a dim= param; varchar defaults to max_length=64 if omitted.

Other collection commands

dodil vbase collection list dodil vbase collection show products # fields, shards, and indexes dodil vbase collection load products # load into memory before searching dodil vbase collection release products # free memory dodil vbase collection drop products

A collection must be loaded before you can search it.

Index β€” dodil vbase index

CommandMilvus op
index create <collection> <field>CreateIndex
index drop <collection> <field>DropIndex
dodil vbase index create products vector --type HNSW --metric COSINE
FlagDefaultAllowed values
--typeFLATFLAT, HNSW, IVF_FLAT, IVF_SQ8
--metricL2L2, IP, COSINE

Choosing an index type

TypeSearchStrengthTrade-off
FLATExactMaximum recall; the correctness baselineLatency grows fastest as data grows
HNSWApproximate (graph)Strong latency/recall defaultHigher memory use
IVF_FLATApproximate (inverted file)Scales well with tunable qualityNeeds tuning for best recall
IVF_SQ8IVF + quantizationLower memory at large scaleMore approximation loss

Choosing a metric

MetricBetter scoreUse when
L2SmallerYou care about absolute (Euclidean) distance.
IPLargerBoth magnitude and direction matter (inner product).
COSINELargerAngular similarity matters more than magnitude.

Set the index --metric to match how you intend to query. Note: the data search command always queries with metric_type=L2 (see below), so for first-class CLI search keep the index on L2, or run searches with a matching metric through the Milvus SDK.

Drop an index by field:

dodil vbase index drop products vector

Data β€” dodil vbase data

CommandMilvus op
data insert <collection>Insert
data search <collection>Search

data insert

Inserts a single row: one id and one float vector.

dodil vbase data insert products \ --id doc-1 \ --vector "0.12,0.04,0.91,0.33"
FlagDefaultNotes
--idβ€”Required. The primary-key value (string).
--id-fieldidMust match the collection’s PK field name.
--vectorβ€”Required. Comma-separated floats.
--vector-fieldvectorMust match the collection’s vector field name.

The CLI inserts the id as a varchar and the vector as a float_vector. For bulk loads, multi-field rows, or int64 ids, use the Milvus SDK.

Runs a top-K vector search.

dodil vbase data search products \ --vector "0.12,0.04,0.91,0.33" \ --topk 5
FlagDefaultNotes
--vectorβ€”Required. Comma-separated query vector.
--topk10Number of results.
--vector-fieldvectorField to search against.
--id-fieldidField returned alongside scores.
Result ID Score doc-1 0.030000 doc-9 0.142000

The command searches with metric_type=L2 and returns the id field plus the score. For other metrics, output fields, or filter expressions, search through the Milvus SDK.

Status & version

dodil vbase status # Milvus CheckHealth against the active database dodil vbase version # CLI version + remote Milvus version
Status Reason true []

status reports the health of the allocated database (Milvus), not the control plane β€” for the control-plane health probe see HealthCheck.


See also