mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 12:58:31 +02:00
feat: add rust snippets
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Qdrant, QdrantError,
|
||||
qdrant::{Document, Query, QueryPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6333").build().unwrap();
|
||||
|
||||
client
|
||||
.query(
|
||||
QueryPointsBuilder::new("<your-collection_name>")
|
||||
.query(Query::new_nearest(Document {
|
||||
text: "How to bake cookies?".into(),
|
||||
model: "qdrant/bm25".into(),
|
||||
options: HashMap::new(),
|
||||
}))
|
||||
.using("my-bm25-vector")
|
||||
.build(),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
Reference in New Issue
Block a user