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.
40 lines
1002 B
C#
40 lines
1002 B
C#
using Qdrant.Client;
|
|
using Qdrant.Client.Grpc;
|
|
|
|
public class Snippet
|
|
{
|
|
public static async Task Run()
|
|
{
|
|
var client = new QdrantClient("localhost", 6334);
|
|
|
|
await client.UpsertAsync(
|
|
collectionName: "{collection_name}",
|
|
points: new List<PointStruct>
|
|
{
|
|
new PointStruct
|
|
{
|
|
Id = 1,
|
|
Vectors = new[] { 0.05f, 0.61f, 0.76f, 0.74f },
|
|
Payload = { ["city"] = "Berlin", ["price"] = 1.99 }
|
|
},
|
|
new PointStruct
|
|
{
|
|
Id = 2,
|
|
Vectors = new[] { 0.19f, 0.81f, 0.75f, 0.11f },
|
|
Payload = { ["city"] = new[] { "Berlin", "London" } }
|
|
},
|
|
new PointStruct
|
|
{
|
|
Id = 3,
|
|
Vectors = new[] { 0.36f, 0.55f, 0.47f, 0.94f },
|
|
Payload =
|
|
{
|
|
["city"] = new[] { "Berlin", "Moscow" },
|
|
["price"] = new Value[] { 1.99, 2.99 }
|
|
}
|
|
}
|
|
}
|
|
);
|
|
}
|
|
}
|