mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 21:08:31 +02:00
22 lines
607 B
Rust
22 lines
607 B
Rust
use qdrant_client::qdrant::{
|
|
CreateCollectionBuilder, Distance, ShardingMethod, VectorParamsBuilder,
|
|
};
|
|
use qdrant_client::Qdrant;
|
|
|
|
pub async fn main() -> anyhow::Result<()> {
|
|
// @hide-start
|
|
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
|
// @hide-end
|
|
|
|
client
|
|
.create_collection(
|
|
CreateCollectionBuilder::new("{collection_name}")
|
|
.vectors_config(VectorParamsBuilder::new(300, Distance::Cosine))
|
|
.shard_number(1)
|
|
.sharding_method(ShardingMethod::Custom.into()),
|
|
)
|
|
.await?;
|
|
|
|
Ok(())
|
|
}
|