mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-07 20:08:32 +02:00
* Python snippets * TS snippets * Rust snippets * Java snippets * C# snippets * Go snippets * Generate .md files * Hide client connection in Rust snippets * Switch to builder pattern for Rust snippets * Use Document::new instead of DocumentBuilder::new * docs: Updated Go snippets Signed-off-by: Anush008 <mail@anush.sh> * docs: Updated Java snippets Signed-off-by: Anush008 <anushshetty90@gmail.com> * docs: Updated C# snippets Signed-off-by: Anush008 <anushshetty90@gmail.com> * docs: Updated BM25 avg_len Java snippet Signed-off-by: Anush008 <anushshetty90@gmail.com> * chore: review and format rust snippets * chore: trigger pr update * chore: remove qdrant_storage folder * fix: remove tokio::main * chore: trigger pr update * Regenerate .md files * George's feedback: set bm25 params at ingest-time, change Python client init to use cloud inference explicitly, and mark bm25 options unavailable in FastEmbed --------- Signed-off-by: Anush008 <mail@anush.sh> Signed-off-by: Anush008 <anushshetty90@gmail.com> Co-authored-by: Anush008 <mail@anush.sh> Co-authored-by: Anush008 <anushshetty90@gmail.com> Co-authored-by: Daniel Boros <dancixx@gmail.com>
44 lines
804 B
Go
44 lines
804 B
Go
package snippet
|
|
|
|
// @hide-start
|
|
import (
|
|
"context"
|
|
|
|
"github.com/qdrant/go-client/qdrant"
|
|
)
|
|
|
|
// @hide-end
|
|
func Main() {
|
|
//@hide-start
|
|
client, err := qdrant.NewClient(&qdrant.Config{
|
|
Host: "localhost",
|
|
Port: 6334,
|
|
})
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
// @hide-end
|
|
|
|
client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
|
CollectionName: "books",
|
|
Points: []*qdrant.PointStruct{
|
|
{
|
|
Id: qdrant.NewIDNum(uint64(1)),
|
|
Vectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{
|
|
"title-bm25": qdrant.NewVectorDocument(&qdrant.Document{
|
|
Model: "qdrant/bm25",
|
|
Text: "The Time Machine",
|
|
}),
|
|
}),
|
|
Payload: qdrant.NewValueMap(map[string]any{
|
|
"title": "The Time Machine",
|
|
"author": "H.G. Wells",
|
|
"isbn": "9780553213515",
|
|
}),
|
|
},
|
|
},
|
|
})
|
|
|
|
}
|