mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-03 01:48:32 +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.
32 lines
643 B
Go
32 lines
643 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.Query(context.Background(), &qdrant.QueryPoints{
|
|
CollectionName: "{collection_name}",
|
|
Prefetch: []*qdrant.PrefetchQuery{
|
|
{
|
|
Query: qdrant.NewQuerySparse([]uint32{1, 42}, []float32{0.22, 0.8}),
|
|
Using: qdrant.PtrOf("sparse"),
|
|
},
|
|
{
|
|
Query: qdrant.NewQueryDense([]float32{0.01, 0.45, 0.67}),
|
|
Using: qdrant.PtrOf("dense"),
|
|
},
|
|
},
|
|
Query: qdrant.NewQueryFusion(qdrant.Fusion_RRF),
|
|
})
|
|
}
|