mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 21:08:31 +02:00
28 lines
604 B
C#
28 lines
604 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.CreateCollectionAsync(
|
|
collectionName: "chunks",
|
|
vectorsConfig: new VectorParams { Size = 4, Distance = Distance.Cosine }
|
|
);
|
|
|
|
await client.CreatePayloadIndexAsync(
|
|
collectionName: "chunks",
|
|
fieldName: "document_id",
|
|
schemaType: PayloadSchemaType.Integer
|
|
);
|
|
|
|
// No vectors, payload only.
|
|
await client.CreateCollectionAsync(
|
|
collectionName: "documents",
|
|
vectorsConfig: new VectorParamsMap()
|
|
);
|
|
}
|
|
}
|