CLI for Milvus
Project description
milvus_cli🚀
- milvus_cli🚀
Overview
Milvus CLI based on Milvus Python ORM SDK
Milvus version | Recommended PyMilvus version | Recommended CLI version |
---|---|---|
1.0.* | 1.0.1 | x |
1.1.* | 1.1.2 | x |
2.0.0-RC1 | 2.0.0rc1 | x |
2.0.0-RC2 | 2.0.0rc2 | 0.1.3 |
2.0.0-RC4 | 2.0.0rc4 | 0.1.4 |
2.0.0-RC5 | 2.0.0rc5 | 0.1.5 |
2.0.0-RC6 | 2.0.0rc6 | 0.1.6 |
Installation
Preparation
-
Install
Python
>= 3.8.5 -
Install
pip
Install from PYPI(recommend)
pip install milvus-cli
Install from release/source code
- Download latest release or
git clone https://github.com/milvus-io/milvus_cli.git
- Enter the direction(
cd milvus_cli/
) and runpython -m pip install --editable .
Usage
Run milvus_cli
commands
clear
milvus_cli > clear --help
Usage: milvus_cli.py clear [OPTIONS]
Clear screen.
Options:
--help Show this message and exit.
connect
milvus_cli > connect --help
Usage: milvus_cli.py connect [OPTIONS]
Connect to Milvus.
Example:
milvus_cli > connect -h 127.0.0.1 -p 19530 -a default
Options:
-a, --alias TEXT Milvus link alias name, default is `default`.
-h, --host TEXT Host name, default is `127.0.0.1`.
-p, --port INTEGER Port, default is `19530`.
--help Show this message and exit.
create
milvus_cli > create --help
Usage: milvus_cli.py create [OPTIONS] COMMAND [ARGS]...
Create collection, partition and index.
Options:
--help Show this message and exit.
Commands:
collection Create partition.
index Create index.
partition Create partition.
create collection
milvus_cli > create collection --help
Usage: milvus_cli.py create collection [OPTIONS]
Create partition.
Example:
create collection -c car -f id:INT64:primary_field -f vector:FLOAT_VECTOR:128 -f color:INT64:color -f brand:INT64:brand -p id -a -d 'car_collection'
Options:
-c, --collection-name TEXT Collection name to be created.
-p, --schema-primary-field TEXT
Primary field name.
-a, --schema-auto-id Enable auto id.
-d, --schema-description TEXT Description details.
-f, --schema-field TEXT FieldSchema. Usage is
"<Name>:<DataType>:<Dim(if vector) or
Description>"
--help Show this message and exit.
create partition
milvus_cli > create partition --help
Usage: milvus_cli.py create partition [OPTIONS]
Create partition.
Example:
milvus_cli > create partition -c car -p new_partition -d test_add_partition
Options:
-c, --collection TEXT Collection name.
-p, --partition TEXT The name of partition.
-d, --description TEXT Partition description.
--help Show this message and exit.
create index
milvus_cli > create index --help
Usage: milvus_cli.py create index [OPTIONS]
Create index.
Example:
create index -c car -f vector -t IVF_FLAT -m L2 -p nlist:128
Options:
-c, --collection TEXT Collection name.
-f, --field TEXT The name of the field to create an index for.
-t, --index-type TEXT Index type.
-m, --index-metric TEXT Index metric type.
-p, --index-params TEXT Index params, usage is "<Name>:<Value>"
-e, --timeout INTEGER An optional duration of time in seconds to allow
for the RPC. When timeout is set to None, client
waits until server response or error occur.
--help Show this message and exit.
delete
milvus_cli > delete --help
Usage: milvus_cli.py delete [OPTIONS] COMMAND [ARGS]...
Delete specified collection, partition and index.
Options:
--help Show this message and exit.
Commands:
collection Drops the collection together with its index files.
index Drop index and its corresponding index files.
partition Drop the partition and its corresponding index files.
delete collection
milvus_cli > delete collection --help
Usage: milvus_cli.py delete collection [OPTIONS]
Drops the collection together with its index files.
Example:
milvus_cli > delete collection -c car
Options:
-c, --collection TEXT The name of collection to be deleted.
-t, --timeout INTEGER An optional duration of time in seconds to allow for
the RPC. If timeout is set to None, the client keeps
waiting until the server responds or an error occurs.
--help Show this message and exit.
delete partition
milvus_cli > delete partition --help
Usage: milvus_cli.py delete partition [OPTIONS]
Drop the partition and its corresponding index files.
Example:
milvus_cli > delete partition -c car -p new_partition
Options:
-c, --collection TEXT Collection name
-p, --partition TEXT The name of partition.
-t, --timeout INTEGER An optional duration of time in seconds to allow for
the RPC. If timeout is set to None, the client keeps
waiting until the server responds or an error occurs.
--help Show this message and exit.
delete index
milvus_cli > delete index --help
Usage: milvus_cli.py delete index [OPTIONS]
Drop index and its corresponding index files.
Example:
milvus_cli > delete index -c car
Options:
-c, --collection TEXT Collection name
-t, --timeout INTEGER An optional duration of time in seconds to allow for
the RPC. If timeout is set to None, the client keeps
waiting until the server responds or an error occurs.
--help Show this message and exit.
describe
milvus_cli > describe --help
Usage: milvus_cli.py describe [OPTIONS] COMMAND [ARGS]...
Describe collection or partition.
Options:
--help Show this message and exit.
Commands:
collection Describe collection.
partition Describe partition.
describe collection
milvus_cli > describe collection --help
Usage: milvus_cli.py describe collection [OPTIONS]
Describe collection.
Example:
milvus_cli > describe collection -c test_collection_insert
Options:
-c, --collection TEXT The name of collection.
--help Show this message and exit.
describe partition
milvus_cli > describe partition --help
Usage: milvus_cli.py describe partition [OPTIONS]
Describe partition.
Example:
milvus_cli > describe partition -c test_collection_insert -p _default
Options:
-c, --collection TEXT The name of collection.
-p, --partition TEXT The name of partition.
--help Show this message and exit.
exit
milvus_cli > exit --help
Usage: milvus_cli.py exit [OPTIONS]
Exit the CLI.
Options:
--help Show this message and exit.
help
milvus_cli > help
Usage: [OPTIONS] COMMAND [ARGS]...
Milvus CLI
Commands:
clear Clear screen.
connect Connect to Milvus.
create Create collection, partition and index.
delete Delete specified collection, partition and index.
describe Describe collection or partition.
exit Exit the CLI.
help Show help messages.
import Import data.
list List collections, partitions and indexes.
load Load specified collection.
query Query with a set of criteria, and results in a list of...
release Release specified collection.
search Conducts a vector similarity search with an optional boolean...
show Show connection, loading_progress and index_progress.
version Get Milvus CLI version.
import
milvus_cli > import --help
Usage: milvus_cli.py import [OPTIONS] PATH
Import data.
Example:
milvus_cli > import 'examples/import_csv/vectors.csv' -c car
Reading csv file... [####################################] 100%
Column names are ['vector', 'color', 'brand']
Processed 50001 lines.
Import successfully.
Options:
-c, --collection TEXT The name of collection to be imported.
-p, --partition TEXT The partition name which the data will be inserted
to, if partition name is not passed, then the data
will be inserted to “_default” partition.
-t, --timeout FLOAT An optional duration of time in seconds to allow for
the RPC. If timeout is set to None, the client keeps
waiting until the server responds or an error occurs.
--help Show this message and exit.
list
milvus_cli > list --help
Usage: milvus_cli.py list [OPTIONS] COMMAND [ARGS]...
List collections, partitions and indexes.
Options:
--help Show this message and exit.
Commands:
collections List all collections.
indexes List all indexes of the specified collection.
partitions List all partitions of the specified collection.
list collections
milvus_cli > list collections --help
Usage: milvus_cli.py list collections [OPTIONS]
List all collections.
Options:
--timeout TEXT [Optional] - An optional duration of time in seconds
to allow for the RPC. When timeout is set to None,
client waits until server response or error occur.
--show-loaded BOOLEAN [Optional] - Only show loaded collections.
--help Show this message and exit.
list indexes
milvus_cli > list indexes --help
Usage: milvus_cli.py list indexes [OPTIONS]
List all indexes of the specified collection.
Options:
-c, --collection TEXT The name of collection.
--help Show this message and exit.
list partitions
milvus_cli > list partitions --help
Usage: milvus_cli.py list partitions [OPTIONS]
List all partitions of the specified collection.
Options:
-c, --collection TEXT The name of collection.
--help Show this message and exit.
load
milvus_cli > load --help
Usage: milvus_cli.py load [OPTIONS]
Load specified collection.
Options:
-c, --collection TEXT The name of collection to load.
--help Show this message and exit.
query
(prompt command)
milvus_cli > query --help
Usage: milvus_cli.py query [OPTIONS]
Query with a set of criteria, and results in a list of records that match
the query exactly.
Example:
milvus_cli > query
Collection name: car
The query expression(field_name in [x,y]): id in [ 427284660842954108, 427284660842954199 ]
Name of partitions that contain entities(split by "," if multiple) []: default
A list of fields to return(split by "," if multiple) []: color, brand
Options:
--help Show this message and exit.
release
milvus_cli > release --help
Usage: milvus_cli.py release [OPTIONS]
Release specified collection.
Options:
-c, --collection TEXT The name of collection to be released.
--help Show this message and exit.
search
(prompt command)
milvus_cli > search --help
Usage: milvus_cli.py search [OPTIONS]
Conducts a vector similarity search with an optional boolean expression as
filter.
Example-1:
Collection name: car
The vectors of search data, the length of data is number of query (nq),
the dim of every vector in data must be equal to vector field’s of
collection: examples/import_csv/search_vectors.csv
The vector field used to search of collection []: vector
Metric type []: L2
The parameters of search(split by "," if multiple) []: nprobe:10
The max number of returned record, also known as topk []: 2
The boolean expression used to filter attribute []: id > 0
The names of partitions to search(split by "," if multiple) []: _default
timeout []:
Example-2:
Collection name: car
The vectors of search data, the length of data is number of query (nq),
the dim of every vector in data must be equal to vector field’s of
collection:
[[0.71, 0.76, 0.17, 0.13, 0.42, 0.07, 0.15, 0.67, 0.58, 0.02, 0.39,
0.47, 0.58, 0.88, 0.73, 0.31, 0.23, 0.57, 0.33, 0.2, 0.03, 0.43,
0.78, 0.49, 0.17, 0.56, 0.76, 0.54, 0.45, 0.46, 0.05, 0.1, 0.43,
0.63, 0.29, 0.44, 0.65, 0.01, 0.35, 0.46, 0.66, 0.7, 0.88, 0.07,
0.49, 0.92, 0.57, 0.5, 0.16, 0.77, 0.98, 0.1, 0.44, 0.88, 0.82,
0.16, 0.67, 0.63, 0.57, 0.55, 0.95, 0.13, 0.64, 0.43, 0.71, 0.81,
0.43, 0.65, 0.76, 0.7, 0.05, 0.24, 0.03, 0.9, 0.46, 0.28, 0.92,
0.25, 0.97, 0.79, 0.73, 0.97, 0.49, 0.28, 0.64, 0.19, 0.23, 0.51,
0.09, 0.1, 0.53, 0.03, 0.23, 0.94, 0.87, 0.14, 0.42, 0.82, 0.91,
0.11, 0.91, 0.37, 0.26, 0.6, 0.89, 0.6, 0.32, 0.11, 0.98, 0.67,
0.12, 0.66, 0.47, 0.02, 0.15, 0.6, 0.64, 0.57, 0.14, 0.81, 0.75,
0.11, 0.49, 0.78, 0.16, 0.63, 0.57, 0.18]]
The vector field used to search of collection []: vector
Metric type []: L2
The parameters of search(split by "," if multiple) []: nprobe:10
The max number of returned record, also known as topk []: 2
The boolean expression used to filter attribute []: id > 0
The names of partitions to search(split by "," if multiple) []: _default
timeout []:
Options:
--help Show this message and exit.
show
milvus_cli > show --help
Usage: milvus_cli.py show [OPTIONS] COMMAND [ARGS]...
Show connection, loading_progress and index_progress.
Options:
--help Show this message and exit.
Commands:
connection Show current/all connection details
index_progress
loading_progress Show #loaded entities vs #total entities.
show connection
milvus_cli > show connection --help
Usage: milvus_cli.py show connection [OPTIONS]
Show current/all connection details
Options:
-a, --all Show all connections.
--help Show this message and exit.
show index_progress
milvus_cli > show index_progress --help
Usage: milvus_cli.py show index_progress [OPTIONS]
Options:
-c, --collection TEXT The name of collection is loading
-i, --index TEXT [Optional] - Index name.
--help Show this message and exit.
show loading_progress
milvus_cli > show loading_progress --help
Usage: milvus_cli.py show loading_progress [OPTIONS]
Show #loaded entities vs #total entities.
Options:
-c, --collection TEXT The name of collection is loading
-p, --partition TEXT [Optional, Multiple] - The names of partitions are
loading
--help Show this message and exit.
version
milvus_cli > --help
Usage: milvus_cli.py [OPTIONS] COMMAND [ARGS]...
Milvus CLI
Options:
--help Show this message and exit.
Commands:
clear Clear screen.
connect Connect to Milvus.
create Create collection, partition and index.
delete Delete specified collection, partition and index.
describe Describe collection or partition.
list List collections, partitions and indexes.
load Load specified collection.
query Query with a set of criteria, and results in a list of...
release Release specified collection.
search Conducts a vector similarity search with an optional boolean...
show Show connection, loading_progress and index_progress.
version Get Milvus CLI version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
milvus_cli-0.1.6.tar.gz
(23.4 kB
view hashes)
Built Distribution
milvus_cli-0.1.6-py3-none-any.whl
(21.6 kB
view hashes)
Close
Hashes for milvus_cli-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07be6419fbd331255cb5411ecc9917d20cd85ad544c9f89dcb9439697f572514 |
|
MD5 | 190bd16cbe22a475d380d1f8d14285d5 |
|
BLAKE2b-256 | 848fb55e64590f7a72d67603900c8275e2fe0773ec43808018c97f8e2b3e60f9 |