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.
36 lines
818 B
Go
36 lines
818 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}",
|
|
VectorsConfig: qdrant.NewVectorsConfigDiffMap(
|
|
map[string]*qdrant.VectorParamsDiff{
|
|
"my_vector": {
|
|
HnswConfig: &qdrant.HnswConfigDiff{
|
|
M: qdrant.PtrOf(uint64(3)),
|
|
EfConstruct: qdrant.PtrOf(uint64(123)),
|
|
},
|
|
},
|
|
}),
|
|
QuantizationConfig: qdrant.NewQuantizationDiffScalar(
|
|
&qdrant.ScalarQuantization{
|
|
Type: qdrant.QuantizationType_Int8,
|
|
Quantile: qdrant.PtrOf(float32(0.8)),
|
|
AlwaysRam: qdrant.PtrOf(true),
|
|
}),
|
|
})
|
|
}
|