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
| Command | Milvus op |
|---|---|
collection create <name> | CreateCollection |
collection list | ShowCollections |
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| Flag | Default | Notes |
|---|---|---|
--dim | 8 | Vector dimension. Must be > 0. |
--id-field | id | Primary-key field name. |
--id-type | varchar | varchar or int64. |
--id-max-length | 64 | Max length for varchar ids. |
--vector-field | vector | Vector field name. |
--vector-type | float_vector | float_vector or binary_vector. |
--dynamic-fields | true | Enable 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 productsA collection must be loaded before you can search it.
Index β dodil vbase index
| Command | Milvus op |
|---|---|
index create <collection> <field> | CreateIndex |
index drop <collection> <field> | DropIndex |
dodil vbase index create products vector --type HNSW --metric COSINE| Flag | Default | Allowed values |
|---|---|---|
--type | FLAT | FLAT, HNSW, IVF_FLAT, IVF_SQ8 |
--metric | L2 | L2, IP, COSINE |
Choosing an index type
| Type | Search | Strength | Trade-off |
|---|---|---|---|
FLAT | Exact | Maximum recall; the correctness baseline | Latency grows fastest as data grows |
HNSW | Approximate (graph) | Strong latency/recall default | Higher memory use |
IVF_FLAT | Approximate (inverted file) | Scales well with tunable quality | Needs tuning for best recall |
IVF_SQ8 | IVF + quantization | Lower memory at large scale | More approximation loss |
Choosing a metric
| Metric | Better score | Use when |
|---|---|---|
L2 | Smaller | You care about absolute (Euclidean) distance. |
IP | Larger | Both magnitude and direction matter (inner product). |
COSINE | Larger | Angular 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 vectorData β dodil vbase data
| Command | Milvus 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"| Flag | Default | Notes |
|---|---|---|
--id | β | Required. The primary-key value (string). |
--id-field | id | Must match the collectionβs PK field name. |
--vector | β | Required. Comma-separated floats. |
--vector-field | vector | Must 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.
data search
Runs a top-K vector search.
dodil vbase data search products \
--vector "0.12,0.04,0.91,0.33" \
--topk 5| Flag | Default | Notes |
|---|---|---|
--vector | β | Required. Comma-separated query vector. |
--topk | 10 | Number of results. |
--vector-field | vector | Field to search against. |
--id-field | id | Field returned alongside scores. |
Result ID Score
doc-1 0.030000
doc-9 0.142000The 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 versionStatus 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
- Connecting with the Milvus SDK β the full data plane, for anything beyond these wrappers.
- Recipes β end-to-end collection + index + search walkthroughs.
- Databases CLI β allocate a database and set the active context first.