Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update readme.md in /docs #69

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
```

Expand All @@ -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)
}
);
```
Expand Down Expand Up @@ -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.
Expand All @@ -101,7 +107,7 @@ foreach(var info in indexInfos){
}

// Then load it
await milvusClient.LoadCollectionAsync(collectionName);
await collection.LoadAsync();
```

### Search and query.
Expand All @@ -126,4 +132,4 @@ queryParameters.OutputFields.Add("word_count");
IReadOnlyList<FieldData> queryResult = await collection.QueryAsync(
expr,
queryParameters);
```
```
Loading