mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 21:08:31 +02:00
This commit both: - Fixes pre-existing mistakes in snippets, aka wrong code samples. - Adds hidden (`@hide`) statements that do not appear in the docs, but satisfy typecheckers.
30 lines
586 B
Go
30 lines
586 B
Go
package snippet
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/qdrant/go-client/qdrant"
|
|
)
|
|
|
|
func Main() {
|
|
client, err := qdrant.NewClient(&qdrant.Config{
|
|
Host: "localhost",
|
|
Port: 6334,
|
|
})
|
|
|
|
if err != nil { panic(err) } // @hide
|
|
|
|
client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{
|
|
CollectionName: "{collection_name}",
|
|
OptimizersConfig: &qdrant.OptimizersConfigDiff{
|
|
IndexingThreshold: qdrant.PtrOf(uint64(10000)),
|
|
},
|
|
Metadata: qdrant.NewValueMap(map[string]any{
|
|
"my-metadata-field": map[string]any{
|
|
"key-a": "value-a",
|
|
"key-b": 42,
|
|
},
|
|
}),
|
|
})
|
|
}
|