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.
33 lines
660 B
Go
33 lines
660 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
|
|
|
|
sample := uint64(10)
|
|
limit := uint64(2)
|
|
res, err := client.SearchMatrixPairs(context.Background(), &qdrant.SearchMatrixPoints{
|
|
CollectionName: "{collection_name}",
|
|
Sample: &sample,
|
|
Limit: &limit,
|
|
Filter: &qdrant.Filter{
|
|
Must: []*qdrant.Condition{
|
|
qdrant.NewMatch("color", "red"),
|
|
},
|
|
},
|
|
})
|
|
|
|
if err != nil { panic(err) } // @hide
|
|
_ = res // @hide
|
|
}
|