From f4a0725efff576f9dd0af5b4f3f2d46bca66af0e Mon Sep 17 00:00:00 2001 From: quachhengtony <quachhengtony@gmail.com> Date: Thu, 21 Mar 2024 10:15:46 +0700 Subject: [PATCH] docs: update readme.md in /docs --- docs/readme.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/readme.md b/docs/readme.md index a370a38..84efca6 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -17,7 +17,13 @@ And restful api support is ready now. ```csharp using Milvus.Client; -MilvusClient milvusClient = new MilvusClient("{Endpoint}", "{Port}", "{Username}", "{Password}", "{Database}(Optional)"); +string Host = "localhost"; +int Port = 19530; // This is Milvus's default port +bool UseSsl = false; // Default value is false +string Database = "my_database"; // Defaults to the default Milvus database + +// See documentation for other constructor paramters +MilvusClient milvusClient = new MilvusClient(Host, Port, UseSsl); MilvusHealthState result = await milvusClient.HealthAsync(); ``` @@ -41,7 +47,7 @@ await milvusClient.CreateCollectionAsync( FieldSchema.Create<long>("book_id", isPrimaryKey:true), FieldSchema.Create<long>("word_count"), FieldSchema.CreateVarchar("book_name", 256), - FieldSchema.CreateFloatVector("book_intro", 2L) + FieldSchema.CreateFloatVector("book_intro", 2) } ); ``` @@ -80,7 +86,7 @@ MutationResult result = await collection.InsertAsync( }); // Check result -Console.WriteLine("Insert count:{0},", result.InsertCount); +Console.WriteLine("Insert status: {0},", result.ToString()); ``` ### Create a index and load collection. @@ -101,7 +107,7 @@ foreach(var info in indexInfos){ } // Then load it -await milvusClient.LoadCollectionAsync(collectionName); +await collection.LoadAsync(); ``` ### Search and query. @@ -126,4 +132,4 @@ queryParameters.OutputFields.Add("word_count"); IReadOnlyList<FieldData> queryResult = await collection.QueryAsync( expr, queryParameters); -``` \ No newline at end of file +```