mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-27 23:18:29 +02:00
chore: simplify snippets
This commit is contained in:
@@ -3,7 +3,6 @@ use qdrant_client::{
|
||||
Payload, Qdrant, QdrantError,
|
||||
qdrant::{Document, PointStruct, UpsertPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6333").build()?;
|
||||
|
||||
@@ -15,7 +14,7 @@ client
|
||||
Document {
|
||||
text: "Recipe for baking chocolate chip cookies".into(),
|
||||
model: "qdrant/bm25".into(),
|
||||
options: HashMap::new(),
|
||||
..Default::default()
|
||||
}.into())]),
|
||||
Payload::default())
|
||||
]))
|
||||
|
||||
@@ -31,7 +31,7 @@ client
|
||||
Document {
|
||||
text: "Mars, the red planet".into(),
|
||||
model: "sentence-transformers/all-minilm-l6-v2".into(),
|
||||
options: HashMap::new(),
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.add_vector(
|
||||
@@ -39,7 +39,7 @@ client
|
||||
Document {
|
||||
text: "How to bake cookies?".into(),
|
||||
model: "qdrant/bm25".into(),
|
||||
options: HashMap::new(),
|
||||
..Default::default()
|
||||
},
|
||||
),
|
||||
Payload::default(),
|
||||
|
||||
@@ -3,7 +3,6 @@ use qdrant_client::{
|
||||
Qdrant, QdrantError,
|
||||
qdrant::{Document, Query, QueryPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6333").build().unwrap();
|
||||
|
||||
@@ -13,7 +12,7 @@ client
|
||||
.query(Query::new_nearest(Document {
|
||||
text: "How to bake cookies?".into(),
|
||||
model: "qdrant/bm25".into(),
|
||||
options: HashMap::new(),
|
||||
..Default::default()
|
||||
}))
|
||||
.using("my-bm25-vector")
|
||||
.build(),
|
||||
|
||||
Reference in New Issue
Block a user