mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 21:08:31 +02:00
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
57 lines
1.0 KiB
C#
57 lines
1.0 KiB
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: "documents",
|
|
points: new List<PointStruct>
|
|
{
|
|
new()
|
|
{
|
|
Id = 200,
|
|
Vectors = new Dictionary<string, Vector>(),
|
|
Payload =
|
|
{
|
|
["title"] = "Document A",
|
|
["text"] = "This is document A",
|
|
},
|
|
},
|
|
new()
|
|
{
|
|
Id = 201,
|
|
Vectors = new Dictionary<string, Vector>(),
|
|
Payload =
|
|
{
|
|
["title"] = "Document B",
|
|
["text"] = "This is document B",
|
|
},
|
|
},
|
|
}
|
|
);
|
|
|
|
await client.UpsertAsync(
|
|
collectionName: "chunks",
|
|
points: new List<PointStruct>
|
|
{
|
|
new()
|
|
{
|
|
Id = 0,
|
|
Vectors = new float[] { 0.1f, 0.2f, 0.3f, 0.4f },
|
|
Payload = { ["document_id"] = 200 },
|
|
},
|
|
new()
|
|
{
|
|
Id = 1,
|
|
Vectors = new float[] { 0.5f, 0.6f, 0.7f, 0.8f },
|
|
Payload = { ["document_id"] = new Value[] { 200L, 201L } },
|
|
},
|
|
}
|
|
);
|
|
}
|
|
}
|