A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/milvus-io/milvus-sdk-rust below:

milvus-io/milvus-sdk-rust: Rust SDK for Milvus.

Rust SDK for Milvus.

This is still in progress, be careful to use it in your production, and we are looking for active maintianers of this repo

Add the SDK into your project:

cargo add milvus-sdk-rust

Connect to milvus service and create collection:

#[tokio::main]
async fn main() -> Result<(), Error> {
    const URL: &str = "http://localhost:19530";

    let client = Client::new(URL).await?;

    let schema =
        CollectionSchemaBuilder::new("hello_milvus", "a guide example for milvus rust SDK")
            .add_field(FieldSchema::new_primary_int64(
                "id",
                "primary key field",
                true,
            ))
            .add_field(FieldSchema::new_float_vector(
                DEFAULT_VEC_FIELD,
                "feature field",
                256,
            ))
            .build()?;
    let collection = client.create_collection(schema.clone(), None).await?;
    Ok(())
}

Pre-requisites:

Many tests require the Milvus server, the project provide a docker-compose file to setup a Milvus cluster:

docker-compose -f ./docker-compose.yml up -d

You may need to wait for seconds until the system ready

Run all tests:

Enable the full backtrace for debugging:

RUST_BACKTRACE=1 cargo test

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4