mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-07 11:58:31 +02:00
* Replace memmap_threshold with indexing_threshold * Update GitHub Stars * Update GitHub Stars * Update GitHub Stars --------- Co-authored-by: myyrakle <16988115+myyrakle@users.noreply.github.com>
30 lines
573 B
Go
30 lines
573 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.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
|
CollectionName: "{collection_name}",
|
|
VectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{
|
|
Size: 768,
|
|
Distance: qdrant.Distance_Cosine,
|
|
}),
|
|
OptimizersConfig: &qdrant.OptimizersConfigDiff{
|
|
IndexingThreshold: qdrant.PtrOf(uint64(20000)),
|
|
},
|
|
})
|
|
}
|