Repository: milvus-io/milvus-sdk-go
Pull request #331 (2022-11-02 09:38:45)

Add index interface v2
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
/kind improvement

sre-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/331#" title="Author self-approved">xiaocai2333</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **congqixia** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @congqixia` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=milvus-io%2Fmilvus-sdk-go).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/milvus-io/milvus-sdk-go/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["congqixia"]} -->
codecov[bot]: # [Codecov](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) Report
> Merging [#331](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) (0dc153b) into [master](https://codecov.io/gh/milvus-io/milvus-sdk-go/commit/b9dc46c5f858970a7e7f157007dab68dbcfbee7c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) (b9dc46c) will **increase** coverage by `0.10%`.
> The diff coverage is `98.05%`.

[![Impacted file tree graph](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331/graphs/tree.svg?width=650&height=150&src=pr&token=WJK43PV390&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io)](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io)

```diff
@@            Coverage Diff             @@
##           master     #331      +/-   ##
==========================================
+ Coverage   88.11%   88.22%   +0.10%     
==========================================
  Files          26       27       +1     
  Lines        2827     2887      +60     
==========================================
+ Hits         2491     2547      +56     
- Misses        247      251       +4     
  Partials       89       89              
```


| [Impacted Files](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) | Coverage Δ | |
|---|---|---|
| [client/client.go](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2NsaWVudC5nbw==) | `71.42% <ø> (ø)` | |
| [client/client\_grpc\_index.go](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2NsaWVudF9ncnBjX2luZGV4Lmdv) | `83.63% <ø> (ø)` | |
| [entity/indexes\_search\_param\_gen.go](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-ZW50aXR5L2luZGV4ZXNfc2VhcmNoX3BhcmFtX2dlbi5nbw==) | `100.00% <ø> (ø)` | |
| [client/client\_grpc\_index\_v2.go](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2NsaWVudF9ncnBjX2luZGV4X3YyLmdv) | `94.59% <94.59%> (ø)` | |
| [entity/indexes\_gen.go](https://codecov.io/gh/milvus-io/milvus-sdk-go/pull/331/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-ZW50aXR5L2luZGV4ZXNfZ2VuLmdv) | `98.99% <99.45%> (-0.02%)` | :arrow_down: |

xiaocai2333: /assign @czs007 
xiaocai2333: /assign @congqixia 
congqixia: @xiaocai2333 @czs007 My suggestion is to implement new index behavior in package clientv2 or client/v2. Maintaining two sets of API in one package may cause confusing and hard to determine when to deprecate the older ones.
WDYGT
sre-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/331#" title="Author self-approved">xiaocai2333</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please ask for approval from **congqixia** after the PR has been reviewed.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=milvus-io%2Fmilvus-sdk-go).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/milvus-io/milvus-sdk-go/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["congqixia"]} -->
sre-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/331#pullrequestreview-1168094447" title="LGTM">congqixia</a>*, *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/331#" title="Author self-approved">xiaocai2333</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=milvus-io%2Fmilvus-sdk-go).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/milvus-io/milvus-sdk-go/blob/master/OWNERS)~~ [congqixia]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/client/client.go b/client/client.go
index cede23a..57ac668 100644
--- a/client/client.go
+++ b/client/client.go
@@ -20,14 +20,13 @@ import (
 
 	grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
 	grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/backoff"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/credentials"
 	"google.golang.org/grpc/credentials/insecure"
 	"google.golang.org/grpc/keepalive"
-
-	"github.com/milvus-io/milvus-sdk-go/v2/entity"
 )
 
 // Client is the interface used to communicate with Milvus
@@ -180,7 +179,7 @@ var DefaultGrpcOpts = []grpc.DialOption{
 // the `Connect` API will be called for you
 // dialOptions contains the dial option(s) that control the grpc dialing process
 func NewGrpcClient(ctx context.Context, addr string, dialOptions ...grpc.DialOption) (Client, error) {
-	c := &grpcClient{}
+	c := &GrpcClient{}
 	if len(dialOptions) == 0 {
 		return NewDefaultGrpcClient(ctx, addr)
 	}
@@ -193,7 +192,7 @@ func NewGrpcClient(ctx context.Context, addr string, dialOptions ...grpc.DialOpt
 }
 
 func NewDefaultGrpcClient(ctx context.Context, addr string) (Client, error) {
-	c := &grpcClient{}
+	c := &GrpcClient{}
 	defaultOpts := append(DefaultGrpcOpts,
 		grpc.WithTransportCredentials(insecure.NewCredentials()),
 		grpc.WithUnaryInterceptor(
diff --git a/client/client_grpc_alias.go b/client/client_grpc_alias.go
index 87c8e2f..9a29fd4 100644
--- a/client/client_grpc_alias.go
+++ b/client/client_grpc_alias.go
@@ -23,8 +23,8 @@ import (
 )
 
 // CreateAlias creates an alias for collection
-func (c *grpcClient) CreateAlias(ctx context.Context, collName string, alias string) error {
-	if c.service == nil {
+func (c *GrpcClient) CreateAlias(ctx context.Context, collName string, alias string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 
@@ -34,7 +34,7 @@ func (c *grpcClient) CreateAlias(ctx context.Context, collName string, alias str
 		Alias:          alias,
 	}
 
-	resp, err := c.service.CreateAlias(ctx, req)
+	resp, err := c.Service.CreateAlias(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -46,8 +46,8 @@ func (c *grpcClient) CreateAlias(ctx context.Context, collName string, alias str
 }
 
 // DropAlias drops the specified Alias
-func (c *grpcClient) DropAlias(ctx context.Context, alias string) error {
-	if c.service == nil {
+func (c *GrpcClient) DropAlias(ctx context.Context, alias string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 
@@ -56,7 +56,7 @@ func (c *grpcClient) DropAlias(ctx context.Context, alias string) error {
 		Alias:  alias,
 	}
 
-	resp, err := c.service.DropAlias(ctx, req)
+	resp, err := c.Service.DropAlias(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -68,8 +68,8 @@ func (c *grpcClient) DropAlias(ctx context.Context, alias string) error {
 }
 
 // AlterAlias changes collection alias to provided alias
-func (c *grpcClient) AlterAlias(ctx context.Context, collName string, alias string) error {
-	if c.service == nil {
+func (c *GrpcClient) AlterAlias(ctx context.Context, collName string, alias string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 
@@ -79,7 +79,7 @@ func (c *grpcClient) AlterAlias(ctx context.Context, collName string, alias stri
 		Alias:          alias,
 	}
 
-	resp, err := c.service.AlterAlias(ctx, req)
+	resp, err := c.Service.AlterAlias(ctx, req)
 	if err != nil {
 		return err
 	}
diff --git a/client/client_grpc_authentication.go b/client/client_grpc_authentication.go
index da075ec..fc844ac 100644
--- a/client/client_grpc_authentication.go
+++ b/client/client_grpc_authentication.go
@@ -8,15 +8,15 @@ import (
 )
 
 // CreateCredential create new user and password
-func (c *grpcClient) CreateCredential(ctx context.Context, username string, password string) error {
-	if c.service == nil {
+func (c *GrpcClient) CreateCredential(ctx context.Context, username string, password string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	req := &server.CreateCredentialRequest{
 		Username: username,
 		Password: crypto.Base64Encode(password),
 	}
-	resp, err := c.service.CreateCredential(ctx, req)
+	resp, err := c.Service.CreateCredential(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -28,8 +28,8 @@ func (c *grpcClient) CreateCredential(ctx context.Context, username string, pass
 }
 
 // UpdateCredential update password for a user
-func (c *grpcClient) UpdateCredential(ctx context.Context, username string, oldPassword string, newPassword string) error {
-	if c.service == nil {
+func (c *GrpcClient) UpdateCredential(ctx context.Context, username string, oldPassword string, newPassword string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	req := &server.UpdateCredentialRequest{
@@ -37,7 +37,7 @@ func (c *grpcClient) UpdateCredential(ctx context.Context, username string, oldP
 		OldPassword: crypto.Base64Encode(oldPassword),
 		NewPassword: crypto.Base64Encode(newPassword),
 	}
-	resp, err := c.service.UpdateCredential(ctx, req)
+	resp, err := c.Service.UpdateCredential(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -49,14 +49,14 @@ func (c *grpcClient) UpdateCredential(ctx context.Context, username string, oldP
 }
 
 // DeleteCredential delete a user
-func (c *grpcClient) DeleteCredential(ctx context.Context, username string) error {
-	if c.service == nil {
+func (c *GrpcClient) DeleteCredential(ctx context.Context, username string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	req := &server.DeleteCredentialRequest{
 		Username: username,
 	}
-	resp, err := c.service.DeleteCredential(ctx, req)
+	resp, err := c.Service.DeleteCredential(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -68,12 +68,12 @@ func (c *grpcClient) DeleteCredential(ctx context.Context, username string) erro
 }
 
 // ListCredUsers list all usernames
-func (c *grpcClient) ListCredUsers(ctx context.Context) ([]string, error) {
-	if c.service == nil {
+func (c *GrpcClient) ListCredUsers(ctx context.Context) ([]string, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	req := &server.ListCredUsersRequest{}
-	resp, err := c.service.ListCredUsers(ctx, req)
+	resp, err := c.Service.ListCredUsers(ctx, req)
 	if err != nil {
 		return nil, err
 	}
diff --git a/client/client_grpc_collection.go b/client/client_grpc_collection.go
index 2d75ad9..f3ebd4f 100644
--- a/client/client_grpc_collection.go
+++ b/client/client_grpc_collection.go
@@ -25,14 +25,14 @@ import (
 	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
 )
 
-// grpcClient, uses default grpc service definition to connect with Milvus2.0
-type grpcClient struct {
-	conn    *grpc.ClientConn           // grpc connection instance
-	service server.MilvusServiceClient // service client stub
+// GrpcClient, uses default grpc Service definition to connect with Milvus2.0
+type GrpcClient struct {
+	Conn    *grpc.ClientConn           // grpc connection instance
+	Service server.MilvusServiceClient // Service client stub
 }
 
-// connect connect to service
-func (c *grpcClient) connect(ctx context.Context, addr string, opts ...grpc.DialOption) error {
+// connect connect to Service
+func (c *GrpcClient) connect(ctx context.Context, addr string, opts ...grpc.DialOption) error {
 	if addr == "" {
 		return fmt.Errorf("address is empty")
 	}
@@ -41,16 +41,16 @@ func (c *grpcClient) connect(ctx context.Context, addr string, opts ...grpc.Dial
 		return err
 	}
 
-	c.conn = conn
-	c.service = server.NewMilvusServiceClient(c.conn)
+	c.Conn = conn
+	c.Service = server.NewMilvusServiceClient(c.Conn)
 	return nil
 }
 
 // Close close the connection
-func (c *grpcClient) Close() error {
-	if c.conn != nil {
-		err := c.conn.Close()
-		c.conn = nil
+func (c *GrpcClient) Close() error {
+	if c.Conn != nil {
+		err := c.Conn.Close()
+		c.Conn = nil
 		return err
 	}
 	return nil
@@ -69,22 +69,22 @@ func handleRespStatus(status *common.Status) error {
 		if status.GetReason() != "" {
 			return ErrServiceFailed(errors.New(status.GetReason()))
 		}
-		return ErrServiceFailed(errors.New("service failed"))
+		return ErrServiceFailed(errors.New("Service failed"))
 	}
 	return nil
 }
 
 // ListCollections list collections from connection
 // Note that schema info are not provided in collection list
-func (c *grpcClient) ListCollections(ctx context.Context) ([]*entity.Collection, error) {
-	if c.service == nil {
+func (c *GrpcClient) ListCollections(ctx context.Context) ([]*entity.Collection, error) {
+	if c.Service == nil {
 		return []*entity.Collection{}, ErrClientNotReady
 	}
 	req := &server.ShowCollectionsRequest{
 		DbName:    "",
 		TimeStamp: 0, // means now
 	}
-	resp, err := c.service.ShowCollections(ctx, req)
+	resp, err := c.Service.ShowCollections(ctx, req)
 	if err != nil {
 		return []*entity.Collection{}, err
 	}
@@ -107,8 +107,8 @@ func (c *grpcClient) ListCollections(ctx context.Context) ([]*entity.Collection,
 }
 
 // CreateCollection create collection with specified schema
-func (c *grpcClient) CreateCollection(ctx context.Context, collSchema *entity.Schema, shardNum int32, opts ...CreateCollectionOption) error {
-	if c.service == nil {
+func (c *GrpcClient) CreateCollection(ctx context.Context, collSchema *entity.Schema, shardNum int32, opts ...CreateCollectionOption) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := validateSchema(collSchema); err != nil {
@@ -140,7 +140,7 @@ func (c *grpcClient) CreateCollection(ctx context.Context, collSchema *entity.Sc
 	for _, opt := range opts {
 		opt(req)
 	}
-	resp, err := c.service.CreateCollection(ctx, req)
+	resp, err := c.Service.CreateCollection(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -191,7 +191,7 @@ func validateSchema(sch *entity.Schema) error {
 	return nil
 }
 
-func (c *grpcClient) checkCollectionExists(ctx context.Context, collName string) error {
+func (c *GrpcClient) checkCollectionExists(ctx context.Context, collName string) error {
 	has, err := c.HasCollection(ctx, collName)
 	if err != nil {
 		return err
@@ -203,14 +203,14 @@ func (c *grpcClient) checkCollectionExists(ctx context.Context, collName string)
 }
 
 // DescribeCollection describe the collection by name
-func (c *grpcClient) DescribeCollection(ctx context.Context, collName string) (*entity.Collection, error) {
-	if c.service == nil {
+func (c *GrpcClient) DescribeCollection(ctx context.Context, collName string) (*entity.Collection, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	req := &server.DescribeCollectionRequest{
 		CollectionName: collName,
 	}
-	resp, err := c.service.DescribeCollection(ctx, req)
+	resp, err := c.Service.DescribeCollection(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -239,8 +239,8 @@ func (c *grpcClient) DescribeCollection(ctx context.Context, collName string) (*
 }
 
 // DropCollection drop collection by name
-func (c *grpcClient) DropCollection(ctx context.Context, collName string) error {
-	if c.service == nil {
+func (c *GrpcClient) DropCollection(ctx context.Context, collName string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -250,7 +250,7 @@ func (c *grpcClient) DropCollection(ctx context.Context, collName string) error
 	req := &server.DropCollectionRequest{
 		CollectionName: collName,
 	}
-	resp, err := c.service.DropCollection(ctx, req)
+	resp, err := c.Service.DropCollection(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -262,8 +262,8 @@ func (c *grpcClient) DropCollection(ctx context.Context, collName string) error
 }
 
 // HasCollection check whether collection name exists
-func (c *grpcClient) HasCollection(ctx context.Context, collName string) (bool, error) {
-	if c.service == nil {
+func (c *GrpcClient) HasCollection(ctx context.Context, collName string) (bool, error) {
+	if c.Service == nil {
 		return false, ErrClientNotReady
 	}
 
@@ -273,7 +273,7 @@ func (c *grpcClient) HasCollection(ctx context.Context, collName string) (bool,
 		TimeStamp:      0, // 0 for now
 	}
 
-	resp, err := c.service.HasCollection(ctx, req)
+	resp, err := c.Service.HasCollection(ctx, req)
 	if err != nil {
 		return false, err
 	}
@@ -284,8 +284,8 @@ func (c *grpcClient) HasCollection(ctx context.Context, collName string) (bool,
 }
 
 // GetCollectionStatistcis show collection statistics
-func (c *grpcClient) GetCollectionStatistics(ctx context.Context, collName string) (map[string]string, error) {
-	if c.service == nil {
+func (c *GrpcClient) GetCollectionStatistics(ctx context.Context, collName string) (map[string]string, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 
@@ -296,7 +296,7 @@ func (c *grpcClient) GetCollectionStatistics(ctx context.Context, collName strin
 	req := &server.GetCollectionStatisticsRequest{
 		CollectionName: collName,
 	}
-	resp, err := c.service.GetCollectionStatistics(ctx, req)
+	resp, err := c.Service.GetCollectionStatistics(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -307,8 +307,8 @@ func (c *grpcClient) GetCollectionStatistics(ctx context.Context, collName strin
 }
 
 // ShowCollection show collection status, used to check whether it is loaded or not
-func (c *grpcClient) ShowCollection(ctx context.Context, collName string) (*entity.Collection, error) {
-	if c.service == nil {
+func (c *GrpcClient) ShowCollection(ctx context.Context, collName string) (*entity.Collection, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -320,7 +320,7 @@ func (c *grpcClient) ShowCollection(ctx context.Context, collName string) (*enti
 		CollectionNames: []string{collName},
 	}
 
-	resp, err := c.service.ShowCollections(ctx, req)
+	resp, err := c.Service.ShowCollections(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -338,8 +338,8 @@ func (c *grpcClient) ShowCollection(ctx context.Context, collName string) (*enti
 }
 
 // LoadCollection load collection into memory
-func (c *grpcClient) LoadCollection(ctx context.Context, collName string, async bool, opts ...LoadCollectionOption) error {
-	if c.service == nil {
+func (c *GrpcClient) LoadCollection(ctx context.Context, collName string, async bool, opts ...LoadCollectionOption) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 
@@ -356,7 +356,7 @@ func (c *grpcClient) LoadCollection(ctx context.Context, collName string, async
 		opt(req)
 	}
 
-	resp, err := c.service.LoadCollection(ctx, req)
+	resp, err := c.Service.LoadCollection(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -387,8 +387,8 @@ func (c *grpcClient) LoadCollection(ctx context.Context, collName string, async
 }
 
 // ReleaseCollection release loaded collection
-func (c *grpcClient) ReleaseCollection(ctx context.Context, collName string) error {
-	if c.service == nil {
+func (c *GrpcClient) ReleaseCollection(ctx context.Context, collName string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -399,7 +399,7 @@ func (c *grpcClient) ReleaseCollection(ctx context.Context, collName string) err
 		DbName:         "", // reserved
 		CollectionName: collName,
 	}
-	resp, err := c.service.ReleaseCollection(ctx, req)
+	resp, err := c.Service.ReleaseCollection(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -407,8 +407,8 @@ func (c *grpcClient) ReleaseCollection(ctx context.Context, collName string) err
 }
 
 // GetReplicas gets the replica groups as well as their querynodes and shards information
-func (c *grpcClient) GetReplicas(ctx context.Context, collName string) ([]*entity.ReplicaGroup, error) {
-	if c.service == nil {
+func (c *GrpcClient) GetReplicas(ctx context.Context, collName string) ([]*entity.ReplicaGroup, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	coll, err := c.ShowCollection(ctx, collName)
@@ -421,7 +421,7 @@ func (c *grpcClient) GetReplicas(ctx context.Context, collName string) ([]*entit
 		WithShardNodes: true, // return nodes by default
 	}
 
-	resp, err := c.service.GetReplicas(ctx, req)
+	resp, err := c.Service.GetReplicas(ctx, req)
 	if err != nil {
 		return nil, err
 	}
diff --git a/client/client_grpc_control.go b/client/client_grpc_control.go
index f21f494..757638e 100644
--- a/client/client_grpc_control.go
+++ b/client/client_grpc_control.go
@@ -26,8 +26,8 @@ import (
 )
 
 // ManualCompaction triggers a compaction on provided collection
-func (c *grpcClient) ManualCompaction(ctx context.Context, collName string, toleranceDuration time.Duration) (int64, error) {
-	if c.service == nil {
+func (c *GrpcClient) ManualCompaction(ctx context.Context, collName string, toleranceDuration time.Duration) (int64, error) {
+	if c.Service == nil {
 		return 0, ErrClientNotReady
 	}
 
@@ -46,7 +46,7 @@ func (c *grpcClient) ManualCompaction(ctx context.Context, collName string, tole
 		Timetravel:   tt,
 	}
 
-	resp, err := c.service.ManualCompaction(ctx, req)
+	resp, err := c.Service.ManualCompaction(ctx, req)
 	if err != nil {
 		return 0, err
 	}
@@ -60,13 +60,13 @@ func (c *grpcClient) ManualCompaction(ctx context.Context, collName string, tole
 }
 
 // GetCompactionState get compaction state of provided compaction id
-func (c *grpcClient) GetCompactionState(ctx context.Context, id int64) (entity.CompactionState, error) {
-	if c.service == nil {
+func (c *GrpcClient) GetCompactionState(ctx context.Context, id int64) (entity.CompactionState, error) {
+	if c.Service == nil {
 		return entity.CompcationStateUndefined, ErrClientNotReady
 	}
 
 	req := &server.GetCompactionStateRequest{CompactionID: id}
-	resp, err := c.service.GetCompactionState(ctx, req)
+	resp, err := c.Service.GetCompactionState(ctx, req)
 	if err != nil {
 		return entity.CompcationStateUndefined, err
 	}
@@ -81,15 +81,15 @@ func (c *grpcClient) GetCompactionState(ctx context.Context, id int64) (entity.C
 }
 
 // GetCompactionStateWithPlans get compaction state with plans of provided compaction id
-func (c *grpcClient) GetCompactionStateWithPlans(ctx context.Context, id int64) (entity.CompactionState, []entity.CompactionPlan, error) {
-	if c.service == nil {
+func (c *GrpcClient) GetCompactionStateWithPlans(ctx context.Context, id int64) (entity.CompactionState, []entity.CompactionPlan, error) {
+	if c.Service == nil {
 		return entity.CompcationStateUndefined, nil, ErrClientNotReady
 	}
 
 	req := &server.GetCompactionPlansRequest{
 		CompactionID: id,
 	}
-	resp, err := c.service.GetCompactionStateWithPlans(ctx, req)
+	resp, err := c.Service.GetCompactionStateWithPlans(ctx, req)
 	if err != nil {
 		return entity.CompcationStateUndefined, nil, err
 	}
diff --git a/client/client_grpc_data.go b/client/client_grpc_data.go
index 4667b42..7bde40c 100644
--- a/client/client_grpc_data.go
+++ b/client/client_grpc_data.go
@@ -32,8 +32,8 @@ import (
 // collName is the collection name
 // partitionName is the partition to insert, if not specified(empty), default partition will be used
 // columns are slice of the column-based data
-func (c *grpcClient) Insert(ctx context.Context, collName string, partitionName string, columns ...entity.Column) (entity.Column, error) {
-	if c.service == nil {
+func (c *GrpcClient) Insert(ctx context.Context, collName string, partitionName string, columns ...entity.Column) (entity.Column, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	// 1. validation for all input params
@@ -108,7 +108,7 @@ func (c *grpcClient) Insert(ctx context.Context, collName string, partitionName
 	for _, column := range columns {
 		req.FieldsData = append(req.FieldsData, column.FieldData())
 	}
-	resp, err := c.service.Insert(ctx, req)
+	resp, err := c.Service.Insert(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -122,8 +122,8 @@ func (c *grpcClient) Insert(ctx context.Context, collName string, partitionName
 
 // Flush force collection to flush memory records into storage
 // in sync mode, flush will wait all segments to be flushed
-func (c *grpcClient) Flush(ctx context.Context, collName string, async bool) error {
-	if c.service == nil {
+func (c *GrpcClient) Flush(ctx context.Context, collName string, async bool) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -133,7 +133,7 @@ func (c *grpcClient) Flush(ctx context.Context, collName string, async bool) err
 		DbName:          "", // reserved,
 		CollectionNames: []string{collName},
 	}
-	resp, err := c.service.Flush(ctx, req)
+	resp, err := c.Service.Flush(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -145,7 +145,7 @@ func (c *grpcClient) Flush(ctx context.Context, collName string, async bool) err
 		ids := segmentIDs.GetData()
 		if has && len(ids) > 0 {
 			flushed := func() bool {
-				resp, err := c.service.GetFlushState(ctx, &server.GetFlushStateRequest{
+				resp, err := c.Service.GetFlushState(ctx, &server.GetFlushStateRequest{
 					SegmentIDs: ids,
 				})
 				if err != nil {
@@ -169,8 +169,8 @@ func (c *grpcClient) Flush(ctx context.Context, collName string, async bool) err
 }
 
 // DeleteByPks deletes entries related to provided primary keys
-func (c *grpcClient) DeleteByPks(ctx context.Context, collName string, partitionName string, ids entity.Column) error {
-	if c.service == nil {
+func (c *GrpcClient) DeleteByPks(ctx context.Context, collName string, partitionName string, ids entity.Column) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 
@@ -212,7 +212,7 @@ func (c *grpcClient) DeleteByPks(ctx context.Context, collName string, partition
 		Expr:           expr,
 	}
 
-	resp, err := c.service.Delete(ctx, req)
+	resp, err := c.Service.Delete(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -225,9 +225,9 @@ func (c *grpcClient) DeleteByPks(ctx context.Context, collName string, partition
 }
 
 // Search with bool expression
-func (c *grpcClient) Search(ctx context.Context, collName string, partitions []string,
+func (c *GrpcClient) Search(ctx context.Context, collName string, partitions []string,
 	expr string, outputFields []string, vectors []entity.Vector, vectorField string, metricType entity.MetricType, topK int, sp entity.SearchParam, opts ...SearchQueryOptionFunc) ([]SearchResult, error) {
-	if c.service == nil {
+	if c.Service == nil {
 		return []SearchResult{}, ErrClientNotReady
 	}
 	_, ok := MetaCache.getCollectionInfo(collName)
@@ -238,14 +238,14 @@ func (c *grpcClient) Search(ctx context.Context, collName string, partitions []s
 	if err != nil {
 		return nil, err
 	}
-	// 2. Request milvus service
+	// 2. Request milvus Service
 	req, err := prepareSearchRequest(collName, partitions, expr, outputFields, vectors, vectorField, metricType, topK, sp, option)
 	if err != nil {
 		return nil, err
 	}
 
 	sr := make([]SearchResult, 0, len(vectors))
-	resp, err := c.service.Search(ctx, req)
+	resp, err := c.Service.Search(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -298,8 +298,8 @@ func PKs2Expr(ids entity.Column) string {
 }
 
 // QueryByPks query record by specified primary key(s)
-func (c *grpcClient) QueryByPks(ctx context.Context, collectionName string, partitionNames []string, ids entity.Column, outputFields []string, opts ...SearchQueryOptionFunc) ([]entity.Column, error) {
-	if c.service == nil {
+func (c *GrpcClient) QueryByPks(ctx context.Context, collectionName string, partitionNames []string, ids entity.Column, outputFields []string, opts ...SearchQueryOptionFunc) ([]entity.Column, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	// check primary keys
@@ -331,7 +331,7 @@ func (c *grpcClient) QueryByPks(ctx context.Context, collectionName string, part
 		GuaranteeTimestamp: option.GuaranteeTimestamp,
 		TravelTimestamp:    option.TravelTimestamp,
 	}
-	resp, err := c.service.Query(ctx, req)
+	resp, err := c.Service.Query(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -403,15 +403,15 @@ func prepareSearchRequest(collName string, partitions []string,
 }
 
 // GetPersistentSegmentInfo get persistent segment info
-func (c *grpcClient) GetPersistentSegmentInfo(ctx context.Context, collName string) ([]*entity.Segment, error) {
-	if c.service == nil {
+func (c *GrpcClient) GetPersistentSegmentInfo(ctx context.Context, collName string) ([]*entity.Segment, error) {
+	if c.Service == nil {
 		return []*entity.Segment{}, ErrClientNotReady
 	}
 	req := &server.GetPersistentSegmentInfoRequest{
 		DbName:         "", // reserved
 		CollectionName: collName,
 	}
-	resp, err := c.service.GetPersistentSegmentInfo(ctx, req)
+	resp, err := c.Service.GetPersistentSegmentInfo(ctx, req)
 	if err != nil {
 		return []*entity.Segment{}, err
 	}
@@ -433,15 +433,15 @@ func (c *grpcClient) GetPersistentSegmentInfo(ctx context.Context, collName stri
 }
 
 // GetQuerySegmentInfo get query query cluster segment loaded info
-func (c *grpcClient) GetQuerySegmentInfo(ctx context.Context, collName string) ([]*entity.Segment, error) {
-	if c.service == nil {
+func (c *GrpcClient) GetQuerySegmentInfo(ctx context.Context, collName string) ([]*entity.Segment, error) {
+	if c.Service == nil {
 		return []*entity.Segment{}, ErrClientNotReady
 	}
 	req := &server.GetQuerySegmentInfoRequest{
 		DbName:         "", // reserved
 		CollectionName: collName,
 	}
-	resp, err := c.service.GetQuerySegmentInfo(ctx, req)
+	resp, err := c.Service.GetQuerySegmentInfo(ctx, req)
 	if err != nil {
 		return []*entity.Segment{}, err
 	}
@@ -463,9 +463,9 @@ func (c *grpcClient) GetQuerySegmentInfo(ctx context.Context, collName string) (
 	return segments, nil
 }
 
-func (c *grpcClient) CalcDistance(ctx context.Context, collName string, partitions []string,
+func (c *GrpcClient) CalcDistance(ctx context.Context, collName string, partitions []string,
 	metricType entity.MetricType, opLeft, opRight entity.Column) (entity.Column, error) {
-	if c.service == nil {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	if opLeft == nil || opRight == nil {
@@ -499,7 +499,7 @@ func (c *grpcClient) CalcDistance(ctx context.Context, collName string, partitio
 		return nil, errors.New("invalid operator passed")
 	}
 
-	resp, err := c.service.CalcDistance(ctx, req)
+	resp, err := c.Service.CalcDistance(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -699,8 +699,8 @@ func estRowSize(sch *entity.Schema, selected []string) int64 {
 }
 
 // BulkInsert data files(json, numpy, etc.) on MinIO/S3 storage, read and parse them into sealed segments
-func (c *grpcClient) BulkInsert(ctx context.Context, collName string, partitionName string, rowBased bool, files []string, opts ...BulkInsertOption) ([]int64, error) {
-	if c.service == nil {
+func (c *GrpcClient) BulkInsert(ctx context.Context, collName string, partitionName string, rowBased bool, files []string, opts ...BulkInsertOption) ([]int64, error) {
+	if c.Service == nil {
 		return []int64{}, ErrClientNotReady
 	}
 	req := &server.ImportRequest{
@@ -714,7 +714,7 @@ func (c *grpcClient) BulkInsert(ctx context.Context, collName string, partitionN
 		opt(req)
 	}
 
-	resp, err := c.service.Import(ctx, req)
+	resp, err := c.Service.Import(ctx, req)
 	if err != nil {
 		return []int64{}, err
 	}
@@ -726,14 +726,14 @@ func (c *grpcClient) BulkInsert(ctx context.Context, collName string, partitionN
 }
 
 // GetBulkInsertState checks import task state
-func (c *grpcClient) GetBulkInsertState(ctx context.Context, taskID int64) (*entity.BulkInsertTaskState, error) {
-	if c.service == nil {
+func (c *GrpcClient) GetBulkInsertState(ctx context.Context, taskID int64) (*entity.BulkInsertTaskState, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	req := &server.GetImportStateRequest{
 		Task: taskID,
 	}
-	resp, err := c.service.GetImportState(ctx, req)
+	resp, err := c.Service.GetImportState(ctx, req)
 	if err != nil {
 		return nil, err
 	}
@@ -754,15 +754,15 @@ func (c *grpcClient) GetBulkInsertState(ctx context.Context, taskID int64) (*ent
 }
 
 // ListBulkInsertTasks list state of all import tasks
-func (c *grpcClient) ListBulkInsertTasks(ctx context.Context, collName string, limit int64) ([]*entity.BulkInsertTaskState, error) {
-	if c.service == nil {
+func (c *GrpcClient) ListBulkInsertTasks(ctx context.Context, collName string, limit int64) ([]*entity.BulkInsertTaskState, error) {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	req := &server.ListImportTasksRequest{
 		CollectionName: collName,
 		Limit:          limit,
 	}
-	resp, err := c.service.ListImportTasks(ctx, req)
+	resp, err := c.Service.ListImportTasks(ctx, req)
 	if err != nil {
 		return nil, err
 	}
diff --git a/client/client_grpc_index.go b/client/client_grpc_index.go
index b52f1b1..15ec57c 100644
--- a/client/client_grpc_index.go
+++ b/client/client_grpc_index.go
@@ -22,7 +22,7 @@ import (
 	"github.com/milvus-io/milvus-sdk-go/v2/entity"
 )
 
-func (c *grpcClient) checkCollField(ctx context.Context, collName string, fieldName string) error {
+func (c *GrpcClient) checkCollField(ctx context.Context, collName string, fieldName string) error {
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
 		return err
 	}
@@ -47,9 +47,10 @@ func (c *grpcClient) checkCollField(ctx context.Context, collName string, fieldN
 }
 
 // CreateIndex create index for collection
-func (c *grpcClient) CreateIndex(ctx context.Context, collName string, fieldName string,
+// Deprecated please use CreateIndexV2 instead.
+func (c *GrpcClient) CreateIndex(ctx context.Context, collName string, fieldName string,
 	idx entity.Index, async bool) error {
-	if c.service == nil {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollField(ctx, collName, fieldName); err != nil {
@@ -67,7 +68,7 @@ func (c *grpcClient) CreateIndex(ctx context.Context, collName string, fieldName
 		FieldName:      fieldName,
 		ExtraParams:    entity.MapKvPairs(idx.Params()),
 	}
-	resp, err := c.service.CreateIndex(ctx, req)
+	resp, err := c.Service.CreateIndex(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -94,8 +95,9 @@ func (c *grpcClient) CreateIndex(ctx context.Context, collName string, fieldName
 }
 
 // DescribeIndex describe index
-func (c *grpcClient) DescribeIndex(ctx context.Context, collName string, fieldName string) ([]entity.Index, error) {
-	if c.service == nil {
+// Deprecate please use DescribeIndexV2 instead.
+func (c *GrpcClient) DescribeIndex(ctx context.Context, collName string, fieldName string) ([]entity.Index, error) {
+	if c.Service == nil {
 		return []entity.Index{}, ErrClientNotReady
 	}
 	if err := c.checkCollField(ctx, collName, fieldName); err != nil {
@@ -106,7 +108,7 @@ func (c *grpcClient) DescribeIndex(ctx context.Context, collName string, fieldNa
 		FieldName:      fieldName,
 		IndexName:      "", // empty string stands for all index on collection
 	}
-	resp, err := c.service.DescribeIndex(ctx, req)
+	resp, err := c.Service.DescribeIndex(ctx, req)
 	if err != nil {
 		return []entity.Index{}, err
 	}
@@ -128,8 +130,9 @@ func (c *grpcClient) DescribeIndex(ctx context.Context, collName string, fieldNa
 }
 
 // DropIndex drop index from collection
-func (c *grpcClient) DropIndex(ctx context.Context, collName string, fieldName string) error {
-	if c.service == nil {
+// Deprecate please use DropIndexV2 instead.
+func (c *GrpcClient) DropIndex(ctx context.Context, collName string, fieldName string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollField(ctx, collName, fieldName); err != nil {
@@ -141,7 +144,7 @@ func (c *grpcClient) DropIndex(ctx context.Context, collName string, fieldName s
 		FieldName:      fieldName,
 		IndexName:      "", //reserved
 	}
-	resp, err := c.service.DropIndex(ctx, req)
+	resp, err := c.Service.DropIndex(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -149,8 +152,9 @@ func (c *grpcClient) DropIndex(ctx context.Context, collName string, fieldName s
 }
 
 // GetIndexState get index state
-func (c *grpcClient) GetIndexState(ctx context.Context, collName string, fieldName string) (entity.IndexState, error) {
-	if c.service == nil {
+// Deprecate please use DescribeIndexV2 instead.
+func (c *GrpcClient) GetIndexState(ctx context.Context, collName string, fieldName string) (entity.IndexState, error) {
+	if c.Service == nil {
 		return entity.IndexState(common.IndexState_Failed), ErrClientNotReady
 	}
 	if err := c.checkCollField(ctx, collName, fieldName); err != nil {
@@ -162,7 +166,7 @@ func (c *grpcClient) GetIndexState(ctx context.Context, collName string, fieldNa
 		FieldName:      fieldName,
 		IndexName:      "",
 	}
-	resp, err := c.service.GetIndexState(ctx, req)
+	resp, err := c.Service.GetIndexState(ctx, req)
 	if err != nil {
 		return entity.IndexState(common.IndexState_IndexStateNone), err
 	}
@@ -174,8 +178,9 @@ func (c *grpcClient) GetIndexState(ctx context.Context, collName string, fieldNa
 }
 
 // GetIndexBuildProgress get index building progress
-func (c *grpcClient) GetIndexBuildProgress(ctx context.Context, collName string, fieldName string) (total, indexed int64, err error) {
-	if c.service == nil {
+// Deprecate please use DescribeIndexV2 instead.
+func (c *GrpcClient) GetIndexBuildProgress(ctx context.Context, collName string, fieldName string) (total, indexed int64, err error) {
+	if c.Service == nil {
 		return 0, 0, ErrClientNotReady
 	}
 	if err := c.checkCollField(ctx, collName, fieldName); err != nil {
@@ -187,7 +192,7 @@ func (c *grpcClient) GetIndexBuildProgress(ctx context.Context, collName string,
 		FieldName:      fieldName,
 		IndexName:      "",
 	}
-	resp, err := c.service.GetIndexBuildProgress(ctx, req)
+	resp, err := c.Service.GetIndexBuildProgress(ctx, req)
 	if err != nil {
 		return 0, 0, err
 	}
diff --git a/client/client_grpc_index_v2.go b/client/client_grpc_index_v2.go
new file mode 100644
index 0000000..86d2609
--- /dev/null
+++ b/client/client_grpc_index_v2.go
@@ -0,0 +1,180 @@
+// Copyright (C) 2019-2021 Zilliz. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software distributed under the License
+// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+// or implied. See the License for the specific language governing permissions and limitations under the License.
+
+package client
+
+import (
+	"context"
+	"errors"
+	"time"
+
+	common "github.com/milvus-io/milvus-proto/go-api/commonpb"
+	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
+)
+
+type CreateIndexRequestOption func(req *server.CreateIndexRequest)
+
+func SetCollectionNameForCreateIndex(name string) CreateIndexRequestOption {
+	return func(req *server.CreateIndexRequest) {
+		req.CollectionName = name
+	}
+}
+
+func SetIndexNameForCreateIndex(name string) CreateIndexRequestOption {
+	return func(req *server.CreateIndexRequest) {
+		req.IndexName = name
+	}
+}
+
+func SetFieldNameForCreateIndex(name string) CreateIndexRequestOption {
+	return func(req *server.CreateIndexRequest) {
+		req.FieldName = name
+	}
+}
+
+// CreateIndexV2 create index for collection
+func (c *GrpcClient) CreateIndexV2(ctx context.Context, async bool, idx entity.Index, opts ...CreateIndexRequestOption) error {
+	if c.Service == nil {
+		return ErrClientNotReady
+	}
+	req := &server.CreateIndexRequest{
+		ExtraParams: entity.MapKvPairs(idx.Params()),
+	}
+	for _, opt := range opts {
+		opt(req)
+	}
+	if req.GetCollectionName() == "" {
+		return errors.New("collection name can not be empty")
+	}
+	if req.GetFieldName() == "" {
+		return errors.New("field name can not be empty")
+	}
+
+	resp, err := c.Service.CreateIndex(ctx, req)
+	if err != nil {
+		return err
+	}
+	if err = handleRespStatus(resp); err != nil {
+		return err
+	}
+	if !async { // sync mode, wait index building result
+		for {
+			resp, err := c.Service.DescribeIndex(ctx, &server.DescribeIndexRequest{
+				DbName:         "",
+				CollectionName: req.GetCollectionName(),
+				FieldName:      req.GetFieldName(),
+				IndexName:      req.GetIndexName(),
+			})
+			if err != nil {
+				return err
+			}
+			if err = handleRespStatus(resp.Status); err != nil {
+				return err
+			}
+			for _, index := range resp.GetIndexDescriptions() {
+				if (req.GetIndexName() == "" && index.FieldName == req.GetFieldName()) || req.GetIndexName() == index.GetIndexName() {
+					switch index.GetState() {
+					case common.IndexState_Failed:
+						return errors.New("index build failed")
+					case common.IndexState_Finished:
+						return nil
+					default:
+					}
+				}
+			}
+			time.Sleep(100 * time.Millisecond) // wait 100ms
+		}
+	}
+	return nil
+}
+
+type DescribeIndexRequestOption func(req *server.DescribeIndexRequest)
+
+func SetCollectionNameForDescribeIndex(name string) DescribeIndexRequestOption {
+	return func(req *server.DescribeIndexRequest) {
+		req.CollectionName = name
+	}
+}
+
+func SetIndexNameForDescribeIndex(name string) DescribeIndexRequestOption {
+	return func(req *server.DescribeIndexRequest) {
+		req.IndexName = name
+	}
+}
+
+func SetFieldNameForDescribeIndex(name string) DescribeIndexRequestOption {
+	return func(req *server.DescribeIndexRequest) {
+		req.FieldName = name
+	}
+}
+
+// DescribeIndexV2 describe index
+func (c *GrpcClient) DescribeIndexV2(ctx context.Context, opts ...DescribeIndexRequestOption) ([]*server.IndexDescription, error) {
+	if c.Service == nil {
+		return []*server.IndexDescription{}, ErrClientNotReady
+	}
+
+	req := &server.DescribeIndexRequest{}
+	for _, opt := range opts {
+		opt(req)
+	}
+	if req.GetCollectionName() == "" {
+		return []*server.IndexDescription{}, errors.New("collection name can not be empty")
+	}
+	resp, err := c.Service.DescribeIndex(ctx, req)
+	if err != nil {
+		return []*server.IndexDescription{}, err
+	}
+	if err := handleRespStatus(resp.GetStatus()); err != nil {
+		return []*server.IndexDescription{}, err
+	}
+	return resp.GetIndexDescriptions(), nil
+}
+
+type DropIndexOption func(request *server.DropIndexRequest)
+
+func SetCollectionNameForDropIndex(name string) DropIndexOption {
+	return func(req *server.DropIndexRequest) {
+		req.CollectionName = name
+	}
+}
+func SetIndexNameForDropIndex(name string) DropIndexOption {
+	return func(req *server.DropIndexRequest) {
+		req.IndexName = name
+	}
+}
+
+func SetFieldNameForDroIndex(name string) DropIndexOption {
+	return func(req *server.DropIndexRequest) {
+		req.FieldName = name
+	}
+}
+
+// DropIndexV2 drop index from collection
+func (c *GrpcClient) DropIndexV2(ctx context.Context, opts ...DropIndexOption) error {
+	if c.Service == nil {
+		return ErrClientNotReady
+	}
+	req := &server.DropIndexRequest{}
+	for _, opt := range opts {
+		opt(req)
+	}
+	if req.GetCollectionName() == "" {
+		return errors.New("collection name can not be empty")
+	}
+
+	resp, err := c.Service.DropIndex(ctx, req)
+	if err != nil {
+		return err
+	}
+	return handleRespStatus(resp)
+}
diff --git a/client/client_grpc_partition.go b/client/client_grpc_partition.go
index cf54ad8..8a16175 100644
--- a/client/client_grpc_partition.go
+++ b/client/client_grpc_partition.go
@@ -23,8 +23,8 @@ import (
 )
 
 // CreatePartition create partition for collection
-func (c *grpcClient) CreatePartition(ctx context.Context, collName string, partitionName string) error {
-	if c.service == nil {
+func (c *GrpcClient) CreatePartition(ctx context.Context, collName string, partitionName string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -43,14 +43,14 @@ func (c *grpcClient) CreatePartition(ctx context.Context, collName string, parti
 		CollectionName: collName,
 		PartitionName:  partitionName,
 	}
-	resp, err := c.service.CreatePartition(ctx, req)
+	resp, err := c.Service.CreatePartition(ctx, req)
 	if err != nil {
 		return err
 	}
 	return handleRespStatus(resp)
 }
 
-func (c *grpcClient) checkPartitionExists(ctx context.Context, collName string, partitionName string) error {
+func (c *GrpcClient) checkPartitionExists(ctx context.Context, collName string, partitionName string) error {
 	has, err := c.HasPartition(ctx, collName, partitionName)
 	if err != nil {
 		return err
@@ -62,8 +62,8 @@ func (c *grpcClient) checkPartitionExists(ctx context.Context, collName string,
 }
 
 // DropPartition drop partition from collection
-func (c *grpcClient) DropPartition(ctx context.Context, collName string, partitionName string) error {
-	if c.service == nil {
+func (c *GrpcClient) DropPartition(ctx context.Context, collName string, partitionName string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -77,7 +77,7 @@ func (c *grpcClient) DropPartition(ctx context.Context, collName string, partiti
 		CollectionName: collName,
 		PartitionName:  partitionName,
 	}
-	resp, err := c.service.DropPartition(ctx, req)
+	resp, err := c.Service.DropPartition(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -85,8 +85,8 @@ func (c *grpcClient) DropPartition(ctx context.Context, collName string, partiti
 }
 
 // HasPartition check whether specified partition exists
-func (c *grpcClient) HasPartition(ctx context.Context, collName string, partitionName string) (bool, error) {
-	if c.service == nil {
+func (c *GrpcClient) HasPartition(ctx context.Context, collName string, partitionName string) (bool, error) {
+	if c.Service == nil {
 		return false, ErrClientNotReady
 	}
 	req := &server.HasPartitionRequest{
@@ -94,7 +94,7 @@ func (c *grpcClient) HasPartition(ctx context.Context, collName string, partitio
 		CollectionName: collName,
 		PartitionName:  partitionName,
 	}
-	resp, err := c.service.HasPartition(ctx, req)
+	resp, err := c.Service.HasPartition(ctx, req)
 	if err != nil {
 		return false, err
 	}
@@ -105,15 +105,15 @@ func (c *grpcClient) HasPartition(ctx context.Context, collName string, partitio
 }
 
 // ShowPartitions list all partitions from collection
-func (c *grpcClient) ShowPartitions(ctx context.Context, collName string) ([]*entity.Partition, error) {
-	if c.service == nil {
+func (c *GrpcClient) ShowPartitions(ctx context.Context, collName string) ([]*entity.Partition, error) {
+	if c.Service == nil {
 		return []*entity.Partition{}, ErrClientNotReady
 	}
 	req := &server.ShowPartitionsRequest{
 		DbName:         "", // reserved
 		CollectionName: collName,
 	}
-	resp, err := c.service.ShowPartitions(ctx, req)
+	resp, err := c.Service.ShowPartitions(ctx, req)
 	if err != nil {
 		return []*entity.Partition{}, err
 	}
@@ -136,8 +136,8 @@ func (c *grpcClient) ShowPartitions(ctx context.Context, collName string) ([]*en
 }
 
 // LoadPartitions load collection paritions into memory
-func (c *grpcClient) LoadPartitions(ctx context.Context, collName string, partitionNames []string, async bool) error {
-	if c.service == nil {
+func (c *GrpcClient) LoadPartitions(ctx context.Context, collName string, partitionNames []string, async bool) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -171,7 +171,7 @@ func (c *grpcClient) LoadPartitions(ctx context.Context, collName string, partit
 		CollectionName: collName,
 		PartitionNames: partitionNames,
 	}
-	resp, err := c.service.LoadPartitions(ctx, req)
+	resp, err := c.Service.LoadPartitions(ctx, req)
 	if err != nil {
 		return err
 	}
@@ -215,8 +215,8 @@ func (c *grpcClient) LoadPartitions(ctx context.Context, collName string, partit
 }
 
 // ReleasePartitions release partitions
-func (c *grpcClient) ReleasePartitions(ctx context.Context, collName string, partitionNames []string) error {
-	if c.service == nil {
+func (c *GrpcClient) ReleasePartitions(ctx context.Context, collName string, partitionNames []string) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	if err := c.checkCollectionExists(ctx, collName); err != nil {
@@ -232,7 +232,7 @@ func (c *grpcClient) ReleasePartitions(ctx context.Context, collName string, par
 		CollectionName: collName,
 		PartitionNames: partitionNames,
 	}
-	resp, err := c.service.ReleasePartitions(ctx, req)
+	resp, err := c.Service.ReleasePartitions(ctx, req)
 	if err != nil {
 		return err
 	}
diff --git a/client/client_grpc_row.go b/client/client_grpc_row.go
index bdc0b2b..99407f3 100644
--- a/client/client_grpc_row.go
+++ b/client/client_grpc_row.go
@@ -13,8 +13,8 @@ import (
 )
 
 // CreateCollectionByRow create collection by row
-func (c *grpcClient) CreateCollectionByRow(ctx context.Context, row entity.Row, shardNum int32) error {
-	if c.service == nil {
+func (c *GrpcClient) CreateCollectionByRow(ctx context.Context, row entity.Row, shardNum int32) error {
+	if c.Service == nil {
 		return ErrClientNotReady
 	}
 	// parse schema from row definition
@@ -38,14 +38,14 @@ func (c *grpcClient) CreateCollectionByRow(ctx context.Context, row entity.Row,
 	if err != nil {
 		return err
 	}
-	// compose request and invoke service
+	// compose request and invoke Service
 	req := &server.CreateCollectionRequest{
 		DbName:         "", // reserved fields, not used for now
 		CollectionName: sch.CollectionName,
 		Schema:         bs,
 		ShardsNum:      shardNum,
 	}
-	resp, err := c.service.CreateCollection(ctx, req)
+	resp, err := c.Service.CreateCollection(ctx, req)
 	// handles response
 	if err != nil {
 		return err
@@ -58,9 +58,9 @@ func (c *grpcClient) CreateCollectionByRow(ctx context.Context, row entity.Row,
 }
 
 // InsertByRows insert by rows
-func (c *grpcClient) InsertByRows(ctx context.Context, collName string, partitionName string,
+func (c *GrpcClient) InsertByRows(ctx context.Context, collName string, partitionName string,
 	rows []entity.Row) (entity.Column, error) {
-	if c.service == nil {
+	if c.Service == nil {
 		return nil, ErrClientNotReady
 	}
 	if len(rows) == 0 {
@@ -92,7 +92,7 @@ func (c *grpcClient) InsertByRows(ctx context.Context, collName string, partitio
 	for _, column := range columns {
 		req.FieldsData = append(req.FieldsData, column.FieldData())
 	}
-	resp, err := c.service.Insert(ctx, req)
+	resp, err := c.Service.Insert(ctx, req)
 	if err != nil {
 		return nil, err
 	}
diff --git a/client/client_mock.go b/client/client_mock.go
new file mode 100644
index 0000000..9a24939
--- /dev/null
+++ b/client/client_mock.go
@@ -0,0 +1,646 @@
+package client
+
+import (
+	"context"
+	"errors"
+	"sync"
+
+	"github.com/golang/protobuf/proto"
+	common "github.com/milvus-io/milvus-proto/go-api/commonpb"
+	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
+)
+
+// ref https://stackoverflow.com/questions/42102496/testing-a-grpc-service
+
+var (
+	errNotImplemented = errors.New("not implemented")
+)
+
+// type alias for Service method
+type ServiceMethod int
+
+const (
+	MCreateCollection        ServiceMethod = 101
+	MDropCollection          ServiceMethod = 102
+	MHasCollection           ServiceMethod = 103
+	MLoadCollection          ServiceMethod = 104
+	MReleaseCollection       ServiceMethod = 105
+	MDescribeCollection      ServiceMethod = 106
+	MListCollection          ServiceMethod = 107
+	MGetCollectionStatistics ServiceMethod = 108
+	MAlterCollection         ServiceMethod = 109
+	MGetLoadingProgress      ServiceMethod = 110
+
+	MCreatePartition   ServiceMethod = 201
+	MDropPartition     ServiceMethod = 202
+	MHasPartition      ServiceMethod = 203
+	MLoadPartitions    ServiceMethod = 204
+	MReleasePartitions ServiceMethod = 205
+	MShowPartitions    ServiceMethod = 206
+
+	MShowCollections ServiceMethod = 301
+	MCreateAlias     ServiceMethod = 302
+	MDropAlias       ServiceMethod = 303
+	MAlterAlias      ServiceMethod = 304
+	MGetReplicas     ServiceMethod = 305
+
+	MCreateIndex           ServiceMethod = 401
+	MDropIndex             ServiceMethod = 402
+	MDescribeIndex         ServiceMethod = 403
+	MGetIndexState         ServiceMethod = 404
+	MGetIndexBuildProgress ServiceMethod = 405
+
+	MCreateCredential ServiceMethod = 500
+	MUpdateCredential ServiceMethod = 501
+	MDeleteCredential ServiceMethod = 502
+	MListCredUsers    ServiceMethod = 503
+
+	MInsert        ServiceMethod = 600
+	MFlush         ServiceMethod = 601
+	MSearch        ServiceMethod = 602
+	MCalcDistance  ServiceMethod = 603
+	MGetFlushState ServiceMethod = 604
+	MDelete        ServiceMethod = 605
+	MQuery         ServiceMethod = 606
+
+	MManualCompaction            ServiceMethod = 700
+	MGetCompactionState          ServiceMethod = 701
+	MGetCompactionStateWithPlans ServiceMethod = 702
+
+	MGetPersistentSegmentInfo ServiceMethod = 800
+	MGetQuerySegmentInfo      ServiceMethod = 801
+
+	MGetComponentStates ServiceMethod = 900
+	MGetVersion         ServiceMethod = 901
+	MCheckHealth        ServiceMethod = 902
+)
+
+// injection function definition
+type TestInjection func(context.Context, proto.Message) (proto.Message, error)
+
+// mock Milvus Server
+type MockServer struct {
+	sync.RWMutex
+	Injections map[ServiceMethod]TestInjection
+}
+
+func (m *MockServer) SetInjection(n ServiceMethod, f TestInjection) {
+	m.Lock()
+	defer m.Unlock()
+	if m.Injections != nil {
+		m.Injections[n] = f
+	}
+}
+
+func (m *MockServer) GetInjection(n ServiceMethod) TestInjection {
+	if m.Injections == nil {
+		return nil
+	}
+	m.RLock()
+	defer m.RUnlock()
+	return m.Injections[n]
+}
+
+func (m *MockServer) DelInjection(n ServiceMethod) {
+	if m.Injections == nil {
+		return
+	}
+	m.Lock()
+	defer m.Unlock()
+	delete(m.Injections, n)
+}
+
+func (m *MockServer) CreateCollection(ctx context.Context, req *server.CreateCollectionRequest) (*common.Status, error) {
+	f := m.GetInjection(MCreateCollection)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) DropCollection(ctx context.Context, req *server.DropCollectionRequest) (*common.Status, error) {
+	f := m.GetInjection(MDropCollection)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+
+	return SuccessStatus()
+}
+
+func (m *MockServer) HasCollection(ctx context.Context, req *server.HasCollectionRequest) (*server.BoolResponse, error) {
+	f := m.GetInjection(MHasCollection)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.BoolResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.BoolResponse{Status: s, Value: false}, err
+}
+
+func (m *MockServer) LoadCollection(ctx context.Context, req *server.LoadCollectionRequest) (*common.Status, error) {
+	f := m.GetInjection(MLoadCollection)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) ReleaseCollection(ctx context.Context, req *server.ReleaseCollectionRequest) (*common.Status, error) {
+	f := m.GetInjection(MReleaseCollection)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) DescribeCollection(ctx context.Context, req *server.DescribeCollectionRequest) (*server.DescribeCollectionResponse, error) {
+	f := m.GetInjection(MDescribeCollection)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.DescribeCollectionResponse), err
+	}
+	r := &server.DescribeCollectionResponse{}
+	s, err := SuccessStatus()
+	r.Status = s
+	return r, err
+}
+
+func (m *MockServer) GetCollectionStatistics(ctx context.Context, req *server.GetCollectionStatisticsRequest) (*server.GetCollectionStatisticsResponse, error) {
+	f := m.GetInjection(MGetCollectionStatistics)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetCollectionStatisticsResponse), err
+	}
+	r := &server.GetCollectionStatisticsResponse{}
+	s, err := SuccessStatus()
+	r.Status = s
+	return r, err
+}
+
+func (m *MockServer) ShowCollections(ctx context.Context, req *server.ShowCollectionsRequest) (*server.ShowCollectionsResponse, error) {
+	f := m.GetInjection(MShowCollections)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.ShowCollectionsResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.ShowCollectionsResponse{Status: s}, err
+}
+
+func (m *MockServer) AlterCollection(ctx context.Context, req *server.AlterCollectionRequest) (*common.Status, error) {
+	f := m.GetInjection(MAlterCollection)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) CreatePartition(ctx context.Context, req *server.CreatePartitionRequest) (*common.Status, error) {
+	f := m.GetInjection(MCreatePartition)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+
+}
+
+func (m *MockServer) DropPartition(ctx context.Context, req *server.DropPartitionRequest) (*common.Status, error) {
+	f := m.GetInjection(MDropPartition)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) HasPartition(ctx context.Context, req *server.HasPartitionRequest) (*server.BoolResponse, error) {
+	f := m.GetInjection(MHasPartition)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.BoolResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.BoolResponse{Status: s, Value: false}, err
+}
+
+func (m *MockServer) LoadPartitions(ctx context.Context, req *server.LoadPartitionsRequest) (*common.Status, error) {
+	f := m.GetInjection(MLoadPartitions)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) ReleasePartitions(ctx context.Context, req *server.ReleasePartitionsRequest) (*common.Status, error) {
+	f := m.GetInjection(MReleasePartitions)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) GetPartitionStatistics(_ context.Context, _ *server.GetPartitionStatisticsRequest) (*server.GetPartitionStatisticsResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) ShowPartitions(ctx context.Context, req *server.ShowPartitionsRequest) (*server.ShowPartitionsResponse, error) {
+	f := m.GetInjection(MShowPartitions)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.ShowPartitionsResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.ShowPartitionsResponse{Status: s}, err
+}
+
+func (m *MockServer) GetLoadingProgress(ctx context.Context, req *server.GetLoadingProgressRequest) (*server.GetLoadingProgressResponse, error) {
+	f := m.GetInjection(MGetLoadingProgress)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetLoadingProgressResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.GetLoadingProgressResponse{Status: s}, err
+}
+
+func (m *MockServer) CreateIndex(ctx context.Context, req *server.CreateIndexRequest) (*common.Status, error) {
+	f := m.GetInjection(MCreateIndex)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) DescribeIndex(ctx context.Context, req *server.DescribeIndexRequest) (*server.DescribeIndexResponse, error) {
+	f := m.GetInjection(MDescribeIndex)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.DescribeIndexResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.DescribeIndexResponse{Status: s}, err
+}
+
+func (m *MockServer) GetIndexState(ctx context.Context, req *server.GetIndexStateRequest) (*server.GetIndexStateResponse, error) {
+	f := m.GetInjection(MGetIndexState)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetIndexStateResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.GetIndexStateResponse{Status: s}, err
+
+}
+
+func (m *MockServer) GetIndexBuildProgress(ctx context.Context, req *server.GetIndexBuildProgressRequest) (*server.GetIndexBuildProgressResponse, error) {
+	f := m.GetInjection(MGetIndexBuildProgress)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetIndexBuildProgressResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.GetIndexBuildProgressResponse{Status: s}, err
+
+}
+
+func (m *MockServer) DropIndex(ctx context.Context, req *server.DropIndexRequest) (*common.Status, error) {
+	f := m.GetInjection(MDropIndex)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) Insert(ctx context.Context, req *server.InsertRequest) (*server.MutationResult, error) {
+	f := m.GetInjection(MInsert)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.MutationResult), err
+	}
+	s, err := SuccessStatus()
+	return &server.MutationResult{Status: s}, err
+}
+
+func (m *MockServer) Search(ctx context.Context, req *server.SearchRequest) (*server.SearchResults, error) {
+	f := m.GetInjection(MSearch)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.SearchResults), err
+	}
+	s, err := SuccessStatus()
+	return &server.SearchResults{Status: s}, err
+}
+
+func (m *MockServer) Flush(ctx context.Context, req *server.FlushRequest) (*server.FlushResponse, error) {
+	f := m.GetInjection(MFlush)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.FlushResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.FlushResponse{Status: s}, err
+}
+
+func (m *MockServer) Query(ctx context.Context, req *server.QueryRequest) (*server.QueryResults, error) {
+	f := m.GetInjection(MQuery)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.QueryResults), err
+	}
+	s, err := SuccessStatus()
+	return &server.QueryResults{Status: s}, err
+}
+
+func (m *MockServer) GetPersistentSegmentInfo(ctx context.Context, req *server.GetPersistentSegmentInfoRequest) (*server.GetPersistentSegmentInfoResponse, error) {
+	f := m.GetInjection(MGetPersistentSegmentInfo)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetPersistentSegmentInfoResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.GetPersistentSegmentInfoResponse{Status: s}, err
+}
+
+func (m *MockServer) GetQuerySegmentInfo(ctx context.Context, req *server.GetQuerySegmentInfoRequest) (*server.GetQuerySegmentInfoResponse, error) {
+	f := m.GetInjection(MGetQuerySegmentInfo)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetQuerySegmentInfoResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.GetQuerySegmentInfoResponse{Status: s}, err
+}
+
+func (m *MockServer) Dummy(_ context.Context, _ *server.DummyRequest) (*server.DummyResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+// TODO: remove
+func (m *MockServer) RegisterLink(_ context.Context, _ *server.RegisterLinkRequest) (*server.RegisterLinkResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) CalcDistance(ctx context.Context, req *server.CalcDistanceRequest) (*server.CalcDistanceResults, error) {
+	f := m.GetInjection(MCalcDistance)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.CalcDistanceResults), err
+	}
+	resp := &server.CalcDistanceResults{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+func (m *MockServer) Delete(ctx context.Context, req *server.DeleteRequest) (*server.MutationResult, error) {
+	f := m.GetInjection(MDelete)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.MutationResult), err
+	}
+	resp := &server.MutationResult{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+// https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
+func (m *MockServer) GetMetrics(_ context.Context, _ *server.GetMetricsRequest) (*server.GetMetricsResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) CreateAlias(ctx context.Context, req *server.CreateAliasRequest) (*common.Status, error) {
+	f := m.GetInjection(MCreateAlias)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) DropAlias(ctx context.Context, req *server.DropAliasRequest) (*common.Status, error) {
+	f := m.GetInjection(MDropAlias)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) AlterAlias(ctx context.Context, req *server.AlterAliasRequest) (*common.Status, error) {
+	f := m.GetInjection(MAlterAlias)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+
+	return SuccessStatus()
+}
+
+func (m *MockServer) GetFlushState(ctx context.Context, req *server.GetFlushStateRequest) (*server.GetFlushStateResponse, error) {
+	f := m.GetInjection(MGetFlushState)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetFlushStateResponse), err
+	}
+
+	resp := &server.GetFlushStateResponse{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+func (m *MockServer) LoadBalance(_ context.Context, _ *server.LoadBalanceRequest) (*common.Status, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) GetCompactionState(ctx context.Context, req *server.GetCompactionStateRequest) (*server.GetCompactionStateResponse, error) {
+	f := m.GetInjection(MGetCompactionState)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetCompactionStateResponse), err
+	}
+
+	resp := &server.GetCompactionStateResponse{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+func (m *MockServer) ManualCompaction(ctx context.Context, req *server.ManualCompactionRequest) (*server.ManualCompactionResponse, error) {
+	f := m.GetInjection(MManualCompaction)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.ManualCompactionResponse), err
+	}
+	resp := &server.ManualCompactionResponse{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+func (m *MockServer) GetCompactionStateWithPlans(ctx context.Context, req *server.GetCompactionPlansRequest) (*server.GetCompactionPlansResponse, error) {
+	f := m.GetInjection(MGetCompactionStateWithPlans)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetCompactionPlansResponse), err
+	}
+
+	resp := &server.GetCompactionPlansResponse{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+func (m *MockServer) GetReplicas(ctx context.Context, req *server.GetReplicasRequest) (*server.GetReplicasResponse, error) {
+	f := m.GetInjection(MGetReplicas)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetReplicasResponse), err
+	}
+	resp := &server.GetReplicasResponse{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+// https://wiki.lfaidata.foundation/display/MIL/MEP+24+--+Support+bulk+load
+func (m *MockServer) Import(_ context.Context, _ *server.ImportRequest) (*server.ImportResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) GetImportState(_ context.Context, _ *server.GetImportStateRequest) (*server.GetImportStateResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) ListImportTasks(_ context.Context, _ *server.ListImportTasksRequest) (*server.ListImportTasksResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+// https://wiki.lfaidata.foundation/display/MIL/MEP+27+--+Support+Basic+Authentication
+func (m *MockServer) CreateCredential(ctx context.Context, req *server.CreateCredentialRequest) (*common.Status, error) {
+	f := m.GetInjection(MCreateCredential)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) UpdateCredential(ctx context.Context, req *server.UpdateCredentialRequest) (*common.Status, error) {
+	f := m.GetInjection(MUpdateCredential)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) DeleteCredential(ctx context.Context, req *server.DeleteCredentialRequest) (*common.Status, error) {
+	f := m.GetInjection(MDeleteCredential)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+func (m *MockServer) ListCredUsers(ctx context.Context, req *server.ListCredUsersRequest) (*server.ListCredUsersResponse, error) {
+	f := m.GetInjection(MListCredUsers)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.ListCredUsersResponse), err
+	}
+	resp := &server.ListCredUsersResponse{}
+	s, err := SuccessStatus()
+	resp.Status = s
+	return resp, err
+}
+
+// https://wiki.lfaidata.foundation/display/MIL/MEP+29+--+Support+Role-Based+Access+Control
+func (m *MockServer) CreateRole(_ context.Context, _ *server.CreateRoleRequest) (*common.Status, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) DropRole(_ context.Context, _ *server.DropRoleRequest) (*common.Status, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) OperateUserRole(_ context.Context, _ *server.OperateUserRoleRequest) (*common.Status, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) SelectRole(_ context.Context, _ *server.SelectRoleRequest) (*server.SelectRoleResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) SelectUser(_ context.Context, _ *server.SelectUserRequest) (*server.SelectUserResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) OperatePrivilege(_ context.Context, _ *server.OperatePrivilegeRequest) (*common.Status, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+func (m *MockServer) SelectGrant(_ context.Context, _ *server.SelectGrantRequest) (*server.SelectGrantResponse, error) {
+	panic("not implemented") // TODO: Implement
+}
+
+//func (m *MockServer) DescribePartition(ctx context.Context, req *server.DescribePartitionRequest) (*server.DescribePartitionResponse, error) {
+//	panic("not implemented") // TODO: Implement
+//}
+
+func (m *MockServer) GetComponentStates(ctx context.Context, req *server.GetComponentStatesRequest) (*server.ComponentStates, error) {
+	f := m.GetInjection(MGetComponentStates)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.ComponentStates), err
+	}
+	s, err := SuccessStatus()
+	return &server.ComponentStates{Status: s}, err
+}
+
+func (m *MockServer) GetVersion(ctx context.Context, req *server.GetVersionRequest) (*server.GetVersionResponse, error) {
+	f := m.GetInjection(MGetVersion)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.GetVersionResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.GetVersionResponse{Status: s}, err
+}
+
+func (m *MockServer) CheckHealth(ctx context.Context, req *server.CheckHealthRequest) (*server.CheckHealthResponse, error) {
+	f := m.GetInjection(MCheckHealth)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.CheckHealthResponse), err
+	}
+	s, err := SuccessStatus()
+	return &server.CheckHealthResponse{Status: s}, err
+}
+
+func SuccessStatus() (*common.Status, error) {
+	return &common.Status{ErrorCode: common.ErrorCode_Success}, nil
+}
+
+func BadRequestStatus() (*common.Status, error) {
+	return &common.Status{ErrorCode: common.ErrorCode_IllegalArgument}, errors.New("illegal request type")
+}
+
+func BadStatus() (*common.Status, error) {
+	return &common.Status{
+		ErrorCode: common.ErrorCode_UnexpectedError,
+		Reason:    "fail reason",
+	}, nil
+}
diff --git a/client/errors.go b/client/errors.go
index 726f0ff..fb0bc84 100644
--- a/client/errors.go
+++ b/client/errors.go
@@ -16,7 +16,7 @@ import (
 	"fmt"
 )
 
-// ErrServiceFailed indicates error returns from milvus service
+// ErrServiceFailed indicates error returns from milvus Service
 type ErrServiceFailed error
 
 var (
diff --git a/client/v2/client.go b/client/v2/client.go
new file mode 100644
index 0000000..e69e792
--- /dev/null
+++ b/client/v2/client.go
@@ -0,0 +1,219 @@
+// Copyright (C) 2019-2021 Zilliz. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software distributed under the License
+// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+// or implied. See the License for the specific language governing permissions and limitations under the License.
+
+package v2
+
+import (
+	"context"
+	"fmt"
+	"math"
+	"time"
+
+	grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
+	grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
+	"google.golang.org/grpc/codes"
+	"google.golang.org/grpc/credentials/insecure"
+
+	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
+	"github.com/milvus-io/milvus-sdk-go/v2/client"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
+	"google.golang.org/grpc"
+)
+
+// Client is the interface used to communicate with Milvus
+type Client interface {
+	// Close the remaining connection resources
+	Close() error
+
+	// -- collection --
+
+	// ListCollections list collections from connection
+	ListCollections(ctx context.Context) ([]*entity.Collection, error)
+	// CreateCollection create collection using provided schema
+	CreateCollection(ctx context.Context, schema *entity.Schema, shardsNum int32, opts ...client.CreateCollectionOption) error
+	// DescribeCollection describe collection meta
+	DescribeCollection(ctx context.Context, collName string) (*entity.Collection, error)
+	// DropCollection drop the specified collection
+	DropCollection(ctx context.Context, collName string) error
+	// GetCollectionStatistics get collection statistics
+	GetCollectionStatistics(ctx context.Context, collName string) (map[string]string, error)
+	// LoadCollection load collection into memory
+	LoadCollection(ctx context.Context, collName string, async bool, opts ...client.LoadCollectionOption) error
+	// ReleaseCollection release loaded collection
+	ReleaseCollection(ctx context.Context, collName string) error
+	// HasCollection check whether collection exists
+	HasCollection(ctx context.Context, collName string) (bool, error)
+
+	// CreateAlias creates an alias for collection
+	CreateAlias(ctx context.Context, collName string, alias string) error
+	// DropAlias drops the specified Alias
+	DropAlias(ctx context.Context, alias string) error
+	// AlterAlias changes collection alias to provided alias
+	AlterAlias(ctx context.Context, collName string, alias string) error
+
+	// GetReplicas gets the replica groups as well as their querynodes and shards information
+	GetReplicas(ctx context.Context, collName string) ([]*entity.ReplicaGroup, error)
+
+	// -- authentication --
+
+	// CreateCredential create new user and password
+	CreateCredential(ctx context.Context, username string, password string) error
+	// UpdateCredential update password for a user
+	UpdateCredential(ctx context.Context, username string, oldPassword string, newPassword string) error
+	// DeleteCredential delete a user
+	DeleteCredential(ctx context.Context, username string) error
+	// ListCredUsers list all usernames
+	ListCredUsers(ctx context.Context) ([]string, error)
+
+	// -- partition --
+
+	// CreatePartition create partition for collection
+	CreatePartition(ctx context.Context, collName string, partitionName string) error
+	// DropPartition drop partition from collection
+	DropPartition(ctx context.Context, collName string, partitionName string) error
+	// ShowPartitions list all partitions from collection
+	ShowPartitions(ctx context.Context, collName string) ([]*entity.Partition, error)
+	// HasPartition check whether partition exists in collection
+	HasPartition(ctx context.Context, collName string, partitionName string) (bool, error)
+	// LoadPartitions load partitions into memory
+	LoadPartitions(ctx context.Context, collName string, partitionNames []string, async bool) error
+	// ReleasePartitions release partitions
+	ReleasePartitions(ctx context.Context, collName string, partitionNames []string) error
+
+	// -- segment --
+	GetPersistentSegmentInfo(ctx context.Context, collName string) ([]*entity.Segment, error)
+	// -- index --
+
+	// CreateIndex create index for field of specified collection
+	// currently index naming is not supported, so only one index on vector field is supported
+	CreateIndex(ctx context.Context, async bool, idx entity.Index, opts ...CreateIndexRequestOption) error
+	// DescribeIndex describe index on collection
+	// currently index naming is not supported, so only one index on vector field is supported
+	DescribeIndex(ctx context.Context, opts ...DescribeIndexRequestOption) ([]*server.IndexDescription, error)
+	// DropIndex drop index from collection with specified field name
+	DropIndex(ctx context.Context, opts ...DropIndexOption) error
+	// GetIndexState get index state with specified collection and field name
+	// index naming is not supported yet
+	// Deprecated use DescribeIndexV2 instead.
+	GetIndexState(ctx context.Context, collName string, fieldName string) (entity.IndexState, error)
+
+	// -- basic operation --
+
+	// Insert column-based data into collection, returns id column values
+	Insert(ctx context.Context, collName string, partitionName string, columns ...entity.Column) (entity.Column, error)
+	// Flush flush collection, specified
+	Flush(ctx context.Context, collName string, async bool) error
+	// DeleteByPks deletes entries related to provided primary keys
+	DeleteByPks(ctx context.Context, collName string, partitionName string, ids entity.Column) error
+	// Search search with bool expression
+	Search(ctx context.Context, collName string, partitions []string,
+		expr string, outputFields []string, vectors []entity.Vector, vectorField string, metricType entity.MetricType, topK int, sp entity.SearchParam, opts ...client.SearchQueryOptionFunc) ([]client.SearchResult, error)
+	// QueryByPks query record by specified primary key(s)
+	QueryByPks(ctx context.Context, collectionName string, partitionNames []string, ids entity.Column, outputFields []string, opts ...client.SearchQueryOptionFunc) ([]entity.Column, error)
+
+	// CalcDistance calculate the distance between vectors specified by ids or provided
+	CalcDistance(ctx context.Context, collName string, partitions []string,
+		metricType entity.MetricType, opLeft, opRight entity.Column) (entity.Column, error)
+
+	// -- row based apis --
+
+	// CreateCollectionByRow create collection by row
+	CreateCollectionByRow(ctx context.Context, row entity.Row, shardNum int32) error
+	// InsertByRows insert by rows
+	InsertByRows(ctx context.Context, collName string, paritionName string, rows []entity.Row) (entity.Column, error)
+
+	// ManualCompaction triggers a compaction on provided collection
+	ManualCompaction(ctx context.Context, collName string, toleranceDuration time.Duration) (int64, error)
+	// GetCompactionState get compaction state of provided compaction id
+	GetCompactionState(ctx context.Context, id int64) (entity.CompactionState, error)
+	// GetCompactionStateWithPlans get compaction state with plans of provided compaction id
+	GetCompactionStateWithPlans(ctx context.Context, id int64) (entity.CompactionState, []entity.CompactionPlan, error)
+
+	// BulkInsert import data files(json, numpy, etc.) on MinIO/S3 storage, read and parse them into sealed segments
+	BulkInsert(ctx context.Context, collName string, partitionName string, rowBased bool, files []string, opts ...client.BulkInsertOption) ([]int64, error)
+	// GetBulkInsertState checks import task state
+	GetBulkInsertState(ctx context.Context, taskID int64) (*entity.BulkInsertTaskState, error)
+	// ListBulkInsertTasks list state of all import tasks
+	ListBulkInsertTasks(ctx context.Context, collName string, limit int64) ([]*entity.BulkInsertTaskState, error)
+}
+
+// grpcClient, uses default grpc service definition to connect with Milvus2.0
+type grpcClient struct {
+	client.GrpcClient
+	//conn    *grpc.ClientConn           // grpc connection instance
+	//service server.MilvusServiceClient // service client stub
+}
+
+// connect connect to service
+func (c *grpcClient) connect(ctx context.Context, addr string, opts ...grpc.DialOption) error {
+	if addr == "" {
+		return fmt.Errorf("address is empty")
+	}
+	conn, err := grpc.Dial(addr, opts...)
+	if err != nil {
+		return err
+	}
+
+	c.Conn = conn
+	c.Service = server.NewMilvusServiceClient(c.Conn)
+	return nil
+}
+
+// Close the connection
+func (c *grpcClient) Close() error {
+	if c.Conn != nil {
+		err := c.Conn.Close()
+		c.Conn = nil
+		return err
+	}
+	return nil
+}
+
+// NewGrpcClient create client with grpc addr
+// the `Connect` API will be called for you
+// dialOptions contains the dial option(s) that control the grpc dialing process
+func NewGrpcClient(ctx context.Context, addr string, dialOptions ...grpc.DialOption) (Client, error) {
+	c := &grpcClient{}
+	if len(dialOptions) == 0 {
+		return NewDefaultGrpcClient(ctx, addr)
+	}
+
+	if err := c.connect(ctx, addr, dialOptions...); err != nil {
+		return nil, err
+	}
+
+	return c, nil
+}
+
+func NewDefaultGrpcClient(ctx context.Context, addr string) (Client, error) {
+	c := &grpcClient{}
+	defaultOpts := append(client.DefaultGrpcOpts,
+		grpc.WithTransportCredentials(insecure.NewCredentials()),
+		grpc.WithUnaryInterceptor(
+			grpc_middleware.ChainUnaryClient(
+				grpc_retry.UnaryClientInterceptor(
+					grpc_retry.WithMax(6),
+					grpc_retry.WithBackoff(func(attempt uint) time.Duration {
+						return 60 * time.Millisecond * time.Duration(math.Pow(3, float64(attempt)))
+					}),
+					grpc_retry.WithCodes(codes.Unavailable, codes.ResourceExhausted)),
+				client.RetryOnRateLimitInterceptor(10, func(ctx context.Context, attempt uint) time.Duration {
+					return 10 * time.Millisecond * time.Duration(math.Pow(3, float64(attempt)))
+				}),
+			),
+		),
+	)
+	err := c.connect(ctx, addr, defaultOpts...)
+	if err != nil {
+		return nil, err
+	}
+	return c, nil
+}
diff --git a/client/v2/client_grpc_index.go b/client/v2/client_grpc_index.go
new file mode 100644
index 0000000..4cc4fb3
--- /dev/null
+++ b/client/v2/client_grpc_index.go
@@ -0,0 +1,199 @@
+// Copyright (C) 2019-2021 Zilliz. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software distributed under the License
+// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+// or implied. See the License for the specific language governing permissions and limitations under the License.
+
+package v2
+
+import (
+	"context"
+	"errors"
+	"time"
+
+	common "github.com/milvus-io/milvus-proto/go-api/commonpb"
+	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
+	"github.com/milvus-io/milvus-sdk-go/v2/client"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
+)
+
+// handles response status
+// if status is nil returns ErrStatusNil
+// if status.ErrorCode is common.ErrorCode_Success, returns nil
+// otherwise, try use Reason into ErrServiceFailed
+// if Reason is empty, returns ErrServiceFailed with default string
+func handleRespStatus(status *common.Status) error {
+	if status == nil {
+		return client.ErrStatusNil
+	}
+	if status.ErrorCode != common.ErrorCode_Success {
+		if status.GetReason() != "" {
+			return client.ErrServiceFailed(errors.New(status.GetReason()))
+		}
+		return client.ErrServiceFailed(errors.New("service failed"))
+	}
+	return nil
+}
+
+type CreateIndexRequestOption func(req *server.CreateIndexRequest)
+
+func SetCollectionNameForCreateIndex(name string) CreateIndexRequestOption {
+	return func(req *server.CreateIndexRequest) {
+		req.CollectionName = name
+	}
+}
+
+func SetIndexNameForCreateIndex(name string) CreateIndexRequestOption {
+	return func(req *server.CreateIndexRequest) {
+		req.IndexName = name
+	}
+}
+
+func SetFieldNameForCreateIndex(name string) CreateIndexRequestOption {
+	return func(req *server.CreateIndexRequest) {
+		req.FieldName = name
+	}
+}
+
+// CreateIndex create index for collection
+func (c *grpcClient) CreateIndex(ctx context.Context, async bool, idx entity.Index, opts ...CreateIndexRequestOption) error {
+	if c.Service == nil {
+		return client.ErrClientNotReady
+	}
+	req := &server.CreateIndexRequest{
+		ExtraParams: entity.MapKvPairs(idx.Params()),
+	}
+	for _, opt := range opts {
+		opt(req)
+	}
+	if req.GetCollectionName() == "" {
+		return errors.New("collection name can not be empty")
+	}
+	if req.GetFieldName() == "" {
+		return errors.New("field name can not be empty")
+	}
+
+	resp, err := c.Service.CreateIndex(ctx, req)
+	if err != nil {
+		return err
+	}
+	if err = handleRespStatus(resp); err != nil {
+		return err
+	}
+	if !async { // sync mode, wait index building result
+		for {
+			resp, err := c.Service.DescribeIndex(ctx, &server.DescribeIndexRequest{
+				DbName:         "",
+				CollectionName: req.GetCollectionName(),
+				FieldName:      req.GetFieldName(),
+				IndexName:      req.GetIndexName(),
+			})
+			if err != nil {
+				return err
+			}
+			if err = handleRespStatus(resp.Status); err != nil {
+				return err
+			}
+			for _, index := range resp.GetIndexDescriptions() {
+				if (req.GetIndexName() == "" && index.FieldName == req.GetFieldName()) || req.GetIndexName() == index.GetIndexName() {
+					switch index.GetState() {
+					case common.IndexState_Failed:
+						return errors.New("index build failed")
+					case common.IndexState_Finished:
+						return nil
+					default:
+					}
+				}
+			}
+			time.Sleep(100 * time.Millisecond) // wait 100ms
+		}
+	}
+	return nil
+}
+
+type DescribeIndexRequestOption func(req *server.DescribeIndexRequest)
+
+func SetCollectionNameForDescribeIndex(name string) DescribeIndexRequestOption {
+	return func(req *server.DescribeIndexRequest) {
+		req.CollectionName = name
+	}
+}
+
+func SetIndexNameForDescribeIndex(name string) DescribeIndexRequestOption {
+	return func(req *server.DescribeIndexRequest) {
+		req.IndexName = name
+	}
+}
+
+func SetFieldNameForDescribeIndex(name string) DescribeIndexRequestOption {
+	return func(req *server.DescribeIndexRequest) {
+		req.FieldName = name
+	}
+}
+
+// DescribeIndex describe index
+func (c *grpcClient) DescribeIndex(ctx context.Context, opts ...DescribeIndexRequestOption) ([]*server.IndexDescription, error) {
+	if c.Service == nil {
+		return []*server.IndexDescription{}, client.ErrClientNotReady
+	}
+
+	req := &server.DescribeIndexRequest{}
+	for _, opt := range opts {
+		opt(req)
+	}
+	if req.GetCollectionName() == "" {
+		return []*server.IndexDescription{}, errors.New("collection name can not be empty")
+	}
+	resp, err := c.Service.DescribeIndex(ctx, req)
+	if err != nil {
+		return []*server.IndexDescription{}, err
+	}
+	if err := handleRespStatus(resp.GetStatus()); err != nil {
+		return []*server.IndexDescription{}, err
+	}
+	return resp.GetIndexDescriptions(), nil
+}
+
+type DropIndexOption func(request *server.DropIndexRequest)
+
+func SetCollectionNameForDropIndex(name string) DropIndexOption {
+	return func(req *server.DropIndexRequest) {
+		req.CollectionName = name
+	}
+}
+func SetIndexNameForDropIndex(name string) DropIndexOption {
+	return func(req *server.DropIndexRequest) {
+		req.IndexName = name
+	}
+}
+
+func SetFieldNameForDroIndex(name string) DropIndexOption {
+	return func(req *server.DropIndexRequest) {
+		req.FieldName = name
+	}
+}
+
+// DropIndex drop index from collection
+func (c *grpcClient) DropIndex(ctx context.Context, opts ...DropIndexOption) error {
+	if c.Service == nil {
+		return client.ErrClientNotReady
+	}
+	req := &server.DropIndexRequest{}
+	for _, opt := range opts {
+		opt(req)
+	}
+	if req.GetCollectionName() == "" {
+		return errors.New("collection name can not be empty")
+	}
+
+	resp, err := c.Service.DropIndex(ctx, req)
+	if err != nil {
+		return err
+	}
+	return handleRespStatus(resp)
+}
diff --git a/entity/genidx/genidx.go b/entity/genidx/genidx.go
index e20dd0a..512ee5c 100644
--- a/entity/genidx/genidx.go
+++ b/entity/genidx/genidx.go
@@ -331,34 +331,18 @@ func main() {
 		Indexes: []idxDef{
 			// FLAT
 			{
-				IdxName: "Flat",
-				IdxType: entity.Flat,
-				ConstructParams: []idxParam{
-					{
-						Name:           "nlist",
-						ValidationRule: "[1, 65536]",
-					},
-				},
-				SearchParams: []idxParam{
-					{
-						Name:           "nprobe",
-						ValidationRule: "[1, 65536]", //[1, nlist]
-					},
-				},
+				IdxName:         "Flat",
+				IdxType:         entity.Flat,
+				ConstructParams: []idxParam{},
+				SearchParams:    []idxParam{},
 				ValidExamples: []string{
-					"nlist = 2048",
-				},
-				InvalidExamples: []string{
-					"nlist = 0",
-					"nlist = 65537",
+					"",
 				},
+				InvalidExamples: []string{},
 				ValidSearchParams: []string{
-					"nprobe = 10",
-				},
-				InvalidSearchParams: []string{
-					"nprobe = 0",
-					"nprobe = 65537",
+					"",
 				},
+				InvalidSearchParams: []string{},
 			},
 			// BIN_FLAT
 			{
diff --git a/entity/indexes_gen.go b/entity/indexes_gen.go
index 6ed80e1..30a1c58 100755
--- a/entity/indexes_gen.go
+++ b/entity/indexes_gen.go
@@ -1,107 +1,97 @@
 // Code generated by go generate; DO NOT EDIT
-// This file is generated by go generate at 2022-10-31 16:28:09.879855599 +0800 CST m=+0.003514342
+// This file is generated by go generate at 2022-11-02 17:52:36.293259532 +0800 CST m=+0.004066234
 
 package entity
 
 import (
-	"encoding/json"
 	"errors"
+	"encoding/json"
 	"fmt"
 )
 
+
+
 var _ Index = &IndexFlat{}
 
 // IndexFlat idx type for FLAT
 type IndexFlat struct { //auto generated fields
-	nlist      int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexFlat) Name() string {
+func(i *IndexFlat) Name() string {
 	return "Flat"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexFlat) IndexType() IndexType {
+func(i *IndexFlat) IndexType() IndexType {
 	return IndexType("FLAT")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexFlat) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexFlat) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexFlat) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist": fmt.Sprintf("%v", i.nlist),
+func(i *IndexFlat) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexFlat create index with construction parameters
-func NewIndexFlat(metricType MetricType,
-	nlist int,
-) (*IndexFlat, error) {
+func NewIndexFlat(metricType MetricType, ) (*IndexFlat, error) {
 	// auto generate parameters validation code, if any
-	if nlist < 1 {
-		return nil, errors.New("nlist not valid")
-	}
-	if nlist > 65536 {
-		return nil, errors.New("nlist not valid")
-	}
-
-	return &IndexFlat{
-		//auto generated setting
-		nlist:      nlist,
-		metricType: metricType,
+	return &IndexFlat{ 
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexBinFlat{}
 
 // IndexBinFlat idx type for BIN_FLAT
 type IndexBinFlat struct { //auto generated fields
-	nlist      int
+	nlist int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexBinFlat) Name() string {
+func(i *IndexBinFlat) Name() string {
 	return "BinFlat"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexBinFlat) IndexType() IndexType {
+func(i *IndexBinFlat) IndexType() IndexType {
 	return IndexType("BIN_FLAT")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexBinFlat) SupportBinary() bool {
-	return 2&2 > 0
+func(i *IndexBinFlat) SupportBinary() bool {
+	return 2 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexBinFlat) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist": fmt.Sprintf("%v", i.nlist),
+func(i *IndexBinFlat) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"nlist": fmt.Sprintf("%v",i.nlist),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexBinFlat create index with construction parameters
-func NewIndexBinFlat(metricType MetricType,
+func NewIndexBinFlat(metricType MetricType, 
 	nlist int,
 ) (*IndexBinFlat, error) {
 	// auto generate parameters validation code, if any
@@ -111,52 +101,53 @@ func NewIndexBinFlat(metricType MetricType,
 	if nlist > 65536 {
 		return nil, errors.New("nlist not valid")
 	}
-
-	return &IndexBinFlat{
-		//auto generated setting
-		nlist:      nlist,
-		metricType: metricType,
+	
+	return &IndexBinFlat{ 
+	//auto generated setting
+	nlist: nlist,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexIvfFlat{}
 
 // IndexIvfFlat idx type for IVF_FLAT
 type IndexIvfFlat struct { //auto generated fields
-	nlist      int
+	nlist int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexIvfFlat) Name() string {
+func(i *IndexIvfFlat) Name() string {
 	return "IvfFlat"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexIvfFlat) IndexType() IndexType {
+func(i *IndexIvfFlat) IndexType() IndexType {
 	return IndexType("IVF_FLAT")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexIvfFlat) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexIvfFlat) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexIvfFlat) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist": fmt.Sprintf("%v", i.nlist),
+func(i *IndexIvfFlat) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"nlist": fmt.Sprintf("%v",i.nlist),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexIvfFlat create index with construction parameters
-func NewIndexIvfFlat(metricType MetricType,
+func NewIndexIvfFlat(metricType MetricType, 
 	nlist int,
 ) (*IndexIvfFlat, error) {
 	// auto generate parameters validation code, if any
@@ -166,52 +157,53 @@ func NewIndexIvfFlat(metricType MetricType,
 	if nlist > 65536 {
 		return nil, errors.New("nlist not valid")
 	}
-
-	return &IndexIvfFlat{
-		//auto generated setting
-		nlist:      nlist,
-		metricType: metricType,
+	
+	return &IndexIvfFlat{ 
+	//auto generated setting
+	nlist: nlist,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexBinIvfFlat{}
 
 // IndexBinIvfFlat idx type for BIN_IVF_FLAT
 type IndexBinIvfFlat struct { //auto generated fields
-	nlist      int
+	nlist int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexBinIvfFlat) Name() string {
+func(i *IndexBinIvfFlat) Name() string {
 	return "BinIvfFlat"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexBinIvfFlat) IndexType() IndexType {
+func(i *IndexBinIvfFlat) IndexType() IndexType {
 	return IndexType("BIN_IVF_FLAT")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexBinIvfFlat) SupportBinary() bool {
-	return 2&2 > 0
+func(i *IndexBinIvfFlat) SupportBinary() bool {
+	return 2 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexBinIvfFlat) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist": fmt.Sprintf("%v", i.nlist),
+func(i *IndexBinIvfFlat) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"nlist": fmt.Sprintf("%v",i.nlist),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexBinIvfFlat create index with construction parameters
-func NewIndexBinIvfFlat(metricType MetricType,
+func NewIndexBinIvfFlat(metricType MetricType, 
 	nlist int,
 ) (*IndexBinIvfFlat, error) {
 	// auto generate parameters validation code, if any
@@ -221,52 +213,53 @@ func NewIndexBinIvfFlat(metricType MetricType,
 	if nlist > 65536 {
 		return nil, errors.New("nlist not valid")
 	}
-
-	return &IndexBinIvfFlat{
-		//auto generated setting
-		nlist:      nlist,
-		metricType: metricType,
+	
+	return &IndexBinIvfFlat{ 
+	//auto generated setting
+	nlist: nlist,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexIvfSQ8{}
 
 // IndexIvfSQ8 idx type for IVF_SQ8
 type IndexIvfSQ8 struct { //auto generated fields
-	nlist      int
+	nlist int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexIvfSQ8) Name() string {
+func(i *IndexIvfSQ8) Name() string {
 	return "IvfSQ8"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexIvfSQ8) IndexType() IndexType {
+func(i *IndexIvfSQ8) IndexType() IndexType {
 	return IndexType("IVF_SQ8")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexIvfSQ8) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexIvfSQ8) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexIvfSQ8) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist": fmt.Sprintf("%v", i.nlist),
+func(i *IndexIvfSQ8) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"nlist": fmt.Sprintf("%v",i.nlist),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexIvfSQ8 create index with construction parameters
-func NewIndexIvfSQ8(metricType MetricType,
+func NewIndexIvfSQ8(metricType MetricType, 
 	nlist int,
 ) (*IndexIvfSQ8, error) {
 	// auto generate parameters validation code, if any
@@ -276,52 +269,53 @@ func NewIndexIvfSQ8(metricType MetricType,
 	if nlist > 65536 {
 		return nil, errors.New("nlist not valid")
 	}
-
-	return &IndexIvfSQ8{
-		//auto generated setting
-		nlist:      nlist,
-		metricType: metricType,
+	
+	return &IndexIvfSQ8{ 
+	//auto generated setting
+	nlist: nlist,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexIvfSQ8H{}
 
 // IndexIvfSQ8H idx type for IVF_SQ8_HYBRID
 type IndexIvfSQ8H struct { //auto generated fields
-	nlist      int
+	nlist int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexIvfSQ8H) Name() string {
+func(i *IndexIvfSQ8H) Name() string {
 	return "IvfSQ8H"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexIvfSQ8H) IndexType() IndexType {
+func(i *IndexIvfSQ8H) IndexType() IndexType {
 	return IndexType("IVF_SQ8_HYBRID")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexIvfSQ8H) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexIvfSQ8H) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexIvfSQ8H) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist": fmt.Sprintf("%v", i.nlist),
+func(i *IndexIvfSQ8H) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"nlist": fmt.Sprintf("%v",i.nlist),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexIvfSQ8H create index with construction parameters
-func NewIndexIvfSQ8H(metricType MetricType,
+func NewIndexIvfSQ8H(metricType MetricType, 
 	nlist int,
 ) (*IndexIvfSQ8H, error) {
 	// auto generate parameters validation code, if any
@@ -331,56 +325,57 @@ func NewIndexIvfSQ8H(metricType MetricType,
 	if nlist > 65536 {
 		return nil, errors.New("nlist not valid")
 	}
-
-	return &IndexIvfSQ8H{
-		//auto generated setting
-		nlist:      nlist,
-		metricType: metricType,
+	
+	return &IndexIvfSQ8H{ 
+	//auto generated setting
+	nlist: nlist,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexIvfPQ{}
 
 // IndexIvfPQ idx type for IVF_PQ
 type IndexIvfPQ struct { //auto generated fields
-	nlist      int
-	m          int
-	nbits      int
+	nlist int
+	m int
+	nbits int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexIvfPQ) Name() string {
+func(i *IndexIvfPQ) Name() string {
 	return "IvfPQ"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexIvfPQ) IndexType() IndexType {
+func(i *IndexIvfPQ) IndexType() IndexType {
 	return IndexType("IVF_PQ")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexIvfPQ) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexIvfPQ) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexIvfPQ) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist": fmt.Sprintf("%v", i.nlist),
-		"m":     fmt.Sprintf("%v", i.m),
-		"nbits": fmt.Sprintf("%v", i.nbits),
+func(i *IndexIvfPQ) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"nlist": fmt.Sprintf("%v",i.nlist),
+		"m": fmt.Sprintf("%v",i.m),
+		"nbits": fmt.Sprintf("%v",i.nbits),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexIvfPQ create index with construction parameters
-func NewIndexIvfPQ(metricType MetricType,
+func NewIndexIvfPQ(metricType MetricType, 
 	nlist int,
 
 	m int,
@@ -394,69 +389,72 @@ func NewIndexIvfPQ(metricType MetricType,
 	if nlist > 65536 {
 		return nil, errors.New("nlist not valid")
 	}
-
+	
+	
+	
 	if nbits < 1 {
 		return nil, errors.New("nbits not valid")
 	}
 	if nbits > 16 {
 		return nil, errors.New("nbits not valid")
 	}
-
-	return &IndexIvfPQ{
-		//auto generated setting
-		nlist: nlist,
-		//auto generated setting
-		m: m,
-		//auto generated setting
-		nbits:      nbits,
-		metricType: metricType,
+	
+	return &IndexIvfPQ{ 
+	//auto generated setting
+	nlist: nlist,
+	//auto generated setting
+	m: m,
+	//auto generated setting
+	nbits: nbits,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexRNSG{}
 
 // IndexRNSG idx type for NSG
 type IndexRNSG struct { //auto generated fields
-	out_degree          int
+	out_degree int
 	candidate_pool_size int
-	search_length       int
-	knng                int
-	metricType          MetricType
+	search_length int
+	knng int
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexRNSG) Name() string {
+func(i *IndexRNSG) Name() string {
 	return "RNSG"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexRNSG) IndexType() IndexType {
+func(i *IndexRNSG) IndexType() IndexType {
 	return IndexType("NSG")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexRNSG) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexRNSG) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexRNSG) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"out_degree":          fmt.Sprintf("%v", i.out_degree),
-		"candidate_pool_size": fmt.Sprintf("%v", i.candidate_pool_size),
-		"search_length":       fmt.Sprintf("%v", i.search_length),
-		"knng":                fmt.Sprintf("%v", i.knng),
+func(i *IndexRNSG) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"out_degree": fmt.Sprintf("%v",i.out_degree),
+		"candidate_pool_size": fmt.Sprintf("%v",i.candidate_pool_size),
+		"search_length": fmt.Sprintf("%v",i.search_length),
+		"knng": fmt.Sprintf("%v",i.knng),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexRNSG create index with construction parameters
-func NewIndexRNSG(metricType MetricType,
+func NewIndexRNSG(metricType MetricType, 
 	out_degree int,
 
 	candidate_pool_size int,
@@ -472,81 +470,82 @@ func NewIndexRNSG(metricType MetricType,
 	if out_degree > 300 {
 		return nil, errors.New("out_degree not valid")
 	}
-
+	
 	if candidate_pool_size < 50 {
 		return nil, errors.New("candidate_pool_size not valid")
 	}
 	if candidate_pool_size > 1000 {
 		return nil, errors.New("candidate_pool_size not valid")
 	}
-
+	
 	if search_length < 10 {
 		return nil, errors.New("search_length not valid")
 	}
 	if search_length > 300 {
 		return nil, errors.New("search_length not valid")
 	}
-
+	
 	if knng < 5 {
 		return nil, errors.New("knng not valid")
 	}
 	if knng > 300 {
 		return nil, errors.New("knng not valid")
 	}
-
-	return &IndexRNSG{
-		//auto generated setting
-		out_degree: out_degree,
-		//auto generated setting
-		candidate_pool_size: candidate_pool_size,
-		//auto generated setting
-		search_length: search_length,
-		//auto generated setting
-		knng:       knng,
-		metricType: metricType,
+	
+	return &IndexRNSG{ 
+	//auto generated setting
+	out_degree: out_degree,
+	//auto generated setting
+	candidate_pool_size: candidate_pool_size,
+	//auto generated setting
+	search_length: search_length,
+	//auto generated setting
+	knng: knng,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexHNSW{}
 
 // IndexHNSW idx type for HNSW
 type IndexHNSW struct { //auto generated fields
-	M              int
+	M int
 	efConstruction int
-	metricType     MetricType
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexHNSW) Name() string {
+func(i *IndexHNSW) Name() string {
 	return "HNSW"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexHNSW) IndexType() IndexType {
+func(i *IndexHNSW) IndexType() IndexType {
 	return IndexType("HNSW")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexHNSW) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexHNSW) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexHNSW) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"M":              fmt.Sprintf("%v", i.M),
-		"efConstruction": fmt.Sprintf("%v", i.efConstruction),
+func(i *IndexHNSW) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"M": fmt.Sprintf("%v",i.M),
+		"efConstruction": fmt.Sprintf("%v",i.efConstruction),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexHNSW create index with construction parameters
-func NewIndexHNSW(metricType MetricType,
+func NewIndexHNSW(metricType MetricType, 
 	M int,
 
 	efConstruction int,
@@ -558,63 +557,64 @@ func NewIndexHNSW(metricType MetricType,
 	if M > 64 {
 		return nil, errors.New("M not valid")
 	}
-
+	
 	if efConstruction < 8 {
 		return nil, errors.New("efConstruction not valid")
 	}
 	if efConstruction > 512 {
 		return nil, errors.New("efConstruction not valid")
 	}
-
-	return &IndexHNSW{
-		//auto generated setting
-		M: M,
-		//auto generated setting
-		efConstruction: efConstruction,
-		metricType:     metricType,
+	
+	return &IndexHNSW{ 
+	//auto generated setting
+	M: M,
+	//auto generated setting
+	efConstruction: efConstruction,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexRHNSWFlat{}
 
 // IndexRHNSWFlat idx type for RHNSW_FLAT
 type IndexRHNSWFlat struct { //auto generated fields
-	M              int
+	M int
 	efConstruction int
-	metricType     MetricType
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexRHNSWFlat) Name() string {
+func(i *IndexRHNSWFlat) Name() string {
 	return "RHNSWFlat"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexRHNSWFlat) IndexType() IndexType {
+func(i *IndexRHNSWFlat) IndexType() IndexType {
 	return IndexType("RHNSW_FLAT")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexRHNSWFlat) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexRHNSWFlat) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexRHNSWFlat) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"M":              fmt.Sprintf("%v", i.M),
-		"efConstruction": fmt.Sprintf("%v", i.efConstruction),
+func(i *IndexRHNSWFlat) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"M": fmt.Sprintf("%v",i.M),
+		"efConstruction": fmt.Sprintf("%v",i.efConstruction),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexRHNSWFlat create index with construction parameters
-func NewIndexRHNSWFlat(metricType MetricType,
+func NewIndexRHNSWFlat(metricType MetricType, 
 	M int,
 
 	efConstruction int,
@@ -626,65 +626,66 @@ func NewIndexRHNSWFlat(metricType MetricType,
 	if M > 64 {
 		return nil, errors.New("M not valid")
 	}
-
+	
 	if efConstruction < 8 {
 		return nil, errors.New("efConstruction not valid")
 	}
 	if efConstruction > 512 {
 		return nil, errors.New("efConstruction not valid")
 	}
-
-	return &IndexRHNSWFlat{
-		//auto generated setting
-		M: M,
-		//auto generated setting
-		efConstruction: efConstruction,
-		metricType:     metricType,
+	
+	return &IndexRHNSWFlat{ 
+	//auto generated setting
+	M: M,
+	//auto generated setting
+	efConstruction: efConstruction,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexRHNSW_PQ{}
 
 // IndexRHNSW_PQ idx type for RHNSW_PQ
 type IndexRHNSW_PQ struct { //auto generated fields
-	M              int
+	M int
 	efConstruction int
-	PQM            int
-	metricType     MetricType
+	PQM int
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexRHNSW_PQ) Name() string {
+func(i *IndexRHNSW_PQ) Name() string {
 	return "RHNSW_PQ"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexRHNSW_PQ) IndexType() IndexType {
+func(i *IndexRHNSW_PQ) IndexType() IndexType {
 	return IndexType("RHNSW_PQ")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexRHNSW_PQ) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexRHNSW_PQ) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexRHNSW_PQ) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"M":              fmt.Sprintf("%v", i.M),
-		"efConstruction": fmt.Sprintf("%v", i.efConstruction),
-		"PQM":            fmt.Sprintf("%v", i.PQM),
+func(i *IndexRHNSW_PQ) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"M": fmt.Sprintf("%v",i.M),
+		"efConstruction": fmt.Sprintf("%v",i.efConstruction),
+		"PQM": fmt.Sprintf("%v",i.PQM),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexRHNSW_PQ create index with construction parameters
-func NewIndexRHNSW_PQ(metricType MetricType,
+func NewIndexRHNSW_PQ(metricType MetricType, 
 	M int,
 
 	efConstruction int,
@@ -698,65 +699,68 @@ func NewIndexRHNSW_PQ(metricType MetricType,
 	if M > 64 {
 		return nil, errors.New("M not valid")
 	}
-
+	
 	if efConstruction < 8 {
 		return nil, errors.New("efConstruction not valid")
 	}
 	if efConstruction > 512 {
 		return nil, errors.New("efConstruction not valid")
 	}
-
-	return &IndexRHNSW_PQ{
-		//auto generated setting
-		M: M,
-		//auto generated setting
-		efConstruction: efConstruction,
-		//auto generated setting
-		PQM:        PQM,
-		metricType: metricType,
+	
+	
+	
+	return &IndexRHNSW_PQ{ 
+	//auto generated setting
+	M: M,
+	//auto generated setting
+	efConstruction: efConstruction,
+	//auto generated setting
+	PQM: PQM,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexRHNSW_SQ{}
 
 // IndexRHNSW_SQ idx type for RHNSW_SQ
 type IndexRHNSW_SQ struct { //auto generated fields
-	M              int
+	M int
 	efConstruction int
-	metricType     MetricType
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexRHNSW_SQ) Name() string {
+func(i *IndexRHNSW_SQ) Name() string {
 	return "RHNSW_SQ"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexRHNSW_SQ) IndexType() IndexType {
+func(i *IndexRHNSW_SQ) IndexType() IndexType {
 	return IndexType("RHNSW_SQ")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexRHNSW_SQ) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexRHNSW_SQ) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexRHNSW_SQ) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"M":              fmt.Sprintf("%v", i.M),
-		"efConstruction": fmt.Sprintf("%v", i.efConstruction),
+func(i *IndexRHNSW_SQ) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"M": fmt.Sprintf("%v",i.M),
+		"efConstruction": fmt.Sprintf("%v",i.efConstruction),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexRHNSW_SQ create index with construction parameters
-func NewIndexRHNSW_SQ(metricType MetricType,
+func NewIndexRHNSW_SQ(metricType MetricType, 
 	M int,
 
 	efConstruction int,
@@ -768,65 +772,66 @@ func NewIndexRHNSW_SQ(metricType MetricType,
 	if M > 64 {
 		return nil, errors.New("M not valid")
 	}
-
+	
 	if efConstruction < 8 {
 		return nil, errors.New("efConstruction not valid")
 	}
 	if efConstruction > 512 {
 		return nil, errors.New("efConstruction not valid")
 	}
-
-	return &IndexRHNSW_SQ{
-		//auto generated setting
-		M: M,
-		//auto generated setting
-		efConstruction: efConstruction,
-		metricType:     metricType,
+	
+	return &IndexRHNSW_SQ{ 
+	//auto generated setting
+	M: M,
+	//auto generated setting
+	efConstruction: efConstruction,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexIvfHNSW{}
 
 // IndexIvfHNSW idx type for IVF_HNSW
 type IndexIvfHNSW struct { //auto generated fields
-	nlist          int
-	M              int
+	nlist int
+	M int
 	efConstruction int
-	metricType     MetricType
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexIvfHNSW) Name() string {
+func(i *IndexIvfHNSW) Name() string {
 	return "IvfHNSW"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexIvfHNSW) IndexType() IndexType {
+func(i *IndexIvfHNSW) IndexType() IndexType {
 	return IndexType("IVF_HNSW")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexIvfHNSW) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexIvfHNSW) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexIvfHNSW) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"nlist":          fmt.Sprintf("%v", i.nlist),
-		"M":              fmt.Sprintf("%v", i.M),
-		"efConstruction": fmt.Sprintf("%v", i.efConstruction),
+func(i *IndexIvfHNSW) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"nlist": fmt.Sprintf("%v",i.nlist),
+		"M": fmt.Sprintf("%v",i.M),
+		"efConstruction": fmt.Sprintf("%v",i.efConstruction),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexIvfHNSW create index with construction parameters
-func NewIndexIvfHNSW(metricType MetricType,
+func NewIndexIvfHNSW(metricType MetricType, 
 	nlist int,
 
 	M int,
@@ -840,70 +845,71 @@ func NewIndexIvfHNSW(metricType MetricType,
 	if nlist > 65536 {
 		return nil, errors.New("nlist not valid")
 	}
-
+	
 	if M < 4 {
 		return nil, errors.New("M not valid")
 	}
 	if M > 64 {
 		return nil, errors.New("M not valid")
 	}
-
+	
 	if efConstruction < 8 {
 		return nil, errors.New("efConstruction not valid")
 	}
 	if efConstruction > 512 {
 		return nil, errors.New("efConstruction not valid")
 	}
-
-	return &IndexIvfHNSW{
-		//auto generated setting
-		nlist: nlist,
-		//auto generated setting
-		M: M,
-		//auto generated setting
-		efConstruction: efConstruction,
-		metricType:     metricType,
+	
+	return &IndexIvfHNSW{ 
+	//auto generated setting
+	nlist: nlist,
+	//auto generated setting
+	M: M,
+	//auto generated setting
+	efConstruction: efConstruction,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexANNOY{}
 
 // IndexANNOY idx type for ANNOY
 type IndexANNOY struct { //auto generated fields
-	n_trees    int
+	n_trees int
 	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexANNOY) Name() string {
+func(i *IndexANNOY) Name() string {
 	return "ANNOY"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexANNOY) IndexType() IndexType {
+func(i *IndexANNOY) IndexType() IndexType {
 	return IndexType("ANNOY")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexANNOY) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexANNOY) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexANNOY) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"n_trees": fmt.Sprintf("%v", i.n_trees),
+func(i *IndexANNOY) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"n_trees": fmt.Sprintf("%v",i.n_trees),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexANNOY create index with construction parameters
-func NewIndexANNOY(metricType MetricType,
+func NewIndexANNOY(metricType MetricType, 
 	n_trees int,
 ) (*IndexANNOY, error) {
 	// auto generate parameters validation code, if any
@@ -913,56 +919,57 @@ func NewIndexANNOY(metricType MetricType,
 	if n_trees > 1024 {
 		return nil, errors.New("n_trees not valid")
 	}
-
-	return &IndexANNOY{
-		//auto generated setting
-		n_trees:    n_trees,
-		metricType: metricType,
+	
+	return &IndexANNOY{ 
+	//auto generated setting
+	n_trees: n_trees,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexNGTPANNG{}
 
 // IndexNGTPANNG idx type for NGT_PANNG
 type IndexNGTPANNG struct { //auto generated fields
-	edge_size                    int
-	forcedly_pruned_edge_size    int
+	edge_size int
+	forcedly_pruned_edge_size int
 	selectively_pruned_edge_size int
-	metricType                   MetricType
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexNGTPANNG) Name() string {
+func(i *IndexNGTPANNG) Name() string {
 	return "NGTPANNG"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexNGTPANNG) IndexType() IndexType {
+func(i *IndexNGTPANNG) IndexType() IndexType {
 	return IndexType("NGT_PANNG")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexNGTPANNG) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexNGTPANNG) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexNGTPANNG) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"edge_size":                    fmt.Sprintf("%v", i.edge_size),
-		"forcedly_pruned_edge_size":    fmt.Sprintf("%v", i.forcedly_pruned_edge_size),
-		"selectively_pruned_edge_size": fmt.Sprintf("%v", i.selectively_pruned_edge_size),
+func(i *IndexNGTPANNG) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"edge_size": fmt.Sprintf("%v",i.edge_size),
+		"forcedly_pruned_edge_size": fmt.Sprintf("%v",i.forcedly_pruned_edge_size),
+		"selectively_pruned_edge_size": fmt.Sprintf("%v",i.selectively_pruned_edge_size),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexNGTPANNG create index with construction parameters
-func NewIndexNGTPANNG(metricType MetricType,
+func NewIndexNGTPANNG(metricType MetricType, 
 	edge_size int,
 
 	forcedly_pruned_edge_size int,
@@ -976,74 +983,75 @@ func NewIndexNGTPANNG(metricType MetricType,
 	if edge_size > 200 {
 		return nil, errors.New("edge_size not valid")
 	}
-
-	if forcedly_pruned_edge_size < selectively_pruned_edge_size+1 {
+	
+	if forcedly_pruned_edge_size < selectively_pruned_edge_size + 1 {
 		return nil, errors.New("forcedly_pruned_edge_size not valid")
 	}
 	if forcedly_pruned_edge_size > 200 {
 		return nil, errors.New("forcedly_pruned_edge_size not valid")
 	}
-
+	
 	if selectively_pruned_edge_size < 1 {
 		return nil, errors.New("selectively_pruned_edge_size not valid")
 	}
-	if selectively_pruned_edge_size > forcedly_pruned_edge_size-1 {
+	if selectively_pruned_edge_size > forcedly_pruned_edge_size -1 {
 		return nil, errors.New("selectively_pruned_edge_size not valid")
 	}
-
-	return &IndexNGTPANNG{
-		//auto generated setting
-		edge_size: edge_size,
-		//auto generated setting
-		forcedly_pruned_edge_size: forcedly_pruned_edge_size,
-		//auto generated setting
-		selectively_pruned_edge_size: selectively_pruned_edge_size,
-		metricType:                   metricType,
+	
+	return &IndexNGTPANNG{ 
+	//auto generated setting
+	edge_size: edge_size,
+	//auto generated setting
+	forcedly_pruned_edge_size: forcedly_pruned_edge_size,
+	//auto generated setting
+	selectively_pruned_edge_size: selectively_pruned_edge_size,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexNGTONNG{}
 
 // IndexNGTONNG idx type for NGT_ONNG
 type IndexNGTONNG struct { //auto generated fields
-	edge_size          int
+	edge_size int
 	outgoing_edge_size int
 	incoming_edge_size int
-	metricType         MetricType
+	metricType MetricType
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexNGTONNG) Name() string {
+func(i *IndexNGTONNG) Name() string {
 	return "NGTONNG"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexNGTONNG) IndexType() IndexType {
+func(i *IndexNGTONNG) IndexType() IndexType {
 	return IndexType("NGT_ONNG")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexNGTONNG) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexNGTONNG) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexNGTONNG) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
-		"edge_size":          fmt.Sprintf("%v", i.edge_size),
-		"outgoing_edge_size": fmt.Sprintf("%v", i.outgoing_edge_size),
-		"incoming_edge_size": fmt.Sprintf("%v", i.incoming_edge_size),
+func(i *IndexNGTONNG) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
+		"edge_size": fmt.Sprintf("%v",i.edge_size),
+		"outgoing_edge_size": fmt.Sprintf("%v",i.outgoing_edge_size),
+		"incoming_edge_size": fmt.Sprintf("%v",i.incoming_edge_size),
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
 
 // NewIndexNGTONNG create index with construction parameters
-func NewIndexNGTONNG(metricType MetricType,
+func NewIndexNGTONNG(metricType MetricType, 
 	edge_size int,
 
 	outgoing_edge_size int,
@@ -1057,32 +1065,33 @@ func NewIndexNGTONNG(metricType MetricType,
 	if edge_size > 200 {
 		return nil, errors.New("edge_size not valid")
 	}
-
+	
 	if outgoing_edge_size < 1 {
 		return nil, errors.New("outgoing_edge_size not valid")
 	}
 	if outgoing_edge_size > 200 {
 		return nil, errors.New("outgoing_edge_size not valid")
 	}
-
+	
 	if incoming_edge_size < 1 {
 		return nil, errors.New("incoming_edge_size not valid")
 	}
 	if incoming_edge_size > 200 {
 		return nil, errors.New("incoming_edge_size not valid")
 	}
-
-	return &IndexNGTONNG{
-		//auto generated setting
-		edge_size: edge_size,
-		//auto generated setting
-		outgoing_edge_size: outgoing_edge_size,
-		//auto generated setting
-		incoming_edge_size: incoming_edge_size,
-		metricType:         metricType,
+	
+	return &IndexNGTONNG{ 
+	//auto generated setting
+	edge_size: edge_size,
+	//auto generated setting
+	outgoing_edge_size: outgoing_edge_size,
+	//auto generated setting
+	incoming_edge_size: incoming_edge_size,
+	metricType: metricType,
 	}, nil
 }
 
+
 var _ Index = &IndexAUTOINDEX{}
 
 // IndexAUTOINDEX idx type for AUTOINDEX
@@ -1091,28 +1100,28 @@ type IndexAUTOINDEX struct { //auto generated fields
 }
 
 // Name returns index type name, implementing Index interface
-func (i *IndexAUTOINDEX) Name() string {
+func(i *IndexAUTOINDEX) Name() string {
 	return "AUTOINDEX"
 }
 
 // IndexType returns IndexType, implementing Index interface
-func (i *IndexAUTOINDEX) IndexType() IndexType {
+func(i *IndexAUTOINDEX) IndexType() IndexType {
 	return IndexType("AUTOINDEX")
 }
 
 // SupportBinary returns whether index type support binary vector
-func (i *IndexAUTOINDEX) SupportBinary() bool {
-	return 0&2 > 0
+func(i *IndexAUTOINDEX) SupportBinary() bool {
+	return 0 & 2 > 0
 }
 
 // Params returns index construction params, implementing Index interface
-func (i *IndexAUTOINDEX) Params() map[string]string {
-	params := map[string]string{ //auto generated mapping
+func(i *IndexAUTOINDEX) Params() map[string]string {
+	params := map[string]string {//auto generated mapping 
 	}
 	bs, _ := json.Marshal(params)
-	return map[string]string{
-		"params":      string(bs),
-		"index_type":  string(i.IndexType()),
+	return map[string]string {
+		"params": string(bs),
+		"index_type": string(i.IndexType()),
 		"metric_type": string(i.metricType),
 	}
 }
@@ -1120,7 +1129,8 @@ func (i *IndexAUTOINDEX) Params() map[string]string {
 // NewIndexAUTOINDEX create index with construction parameters
 func NewIndexAUTOINDEX(metricType MetricType, ) (*IndexAUTOINDEX, error) {
 	// auto generate parameters validation code, if any
-	return &IndexAUTOINDEX{
-		metricType: metricType,
+	return &IndexAUTOINDEX{ 
+	metricType: metricType,
 	}, nil
 }
+
diff --git a/entity/indexes_search_param_gen.go b/entity/indexes_search_param_gen.go
index 2d3cbf0..dde63d0 100755
--- a/entity/indexes_search_param_gen.go
+++ b/entity/indexes_search_param_gen.go
@@ -1,5 +1,5 @@
 // Code generated by go generate; DO NOT EDIT
-// This file is generated by go generate at 2022-10-31 16:28:09.879855599 +0800 CST m=+0.003514342
+// This file is generated by go generate at 2022-11-02 17:52:36.293259532 +0800 CST m=+0.004066234
 
 package entity
 
@@ -12,31 +12,18 @@ var _ SearchParam = &IndexFlatSearchParam{}
 
 // IndexFlatSearchParam search param struct for index type FLAT
 type IndexFlatSearchParam struct { //auto generated fields
-	nprobe int
 }
 
 // Params returns index construction params, implementing Index interface
 func(i *IndexFlatSearchParam) Params() map[string]interface{} {
 	return map[string]interface{} {//auto generated mapping 
-		"nprobe": i.nprobe,
 	}
 }
 
 // NewIndexFlatSearchParam create index search param
-func NewIndexFlatSearchParam(
-	nprobe int,
-) (*IndexFlatSearchParam, error) {
+func NewIndexFlatSearchParam() (*IndexFlatSearchParam, error) {
 	// auto generate parameters validation code, if any
-	if nprobe < 1 {
-		return nil, errors.New("nprobe not valid")
-	}
-	if nprobe > 65536 {
-		return nil, errors.New("nprobe not valid")
-	}
-	
 	return &IndexFlatSearchParam{ 
-	//auto generated setting
-	nprobe: nprobe,
 	}, nil
 }
 
diff --git a/examples/auth/auth.go b/examples/auth/auth.go
index 9f9b822..da53e7b 100644
--- a/examples/auth/auth.go
+++ b/examples/auth/auth.go
@@ -116,7 +116,7 @@ func main() {
 	searchFilm := films[0] // use first fim to search
 	vector := entity.FloatVector(searchFilm.Vector[:])
 	// Use flat search param
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	sr, err := c.Search(ctx, collectionName, []string{}, "Year > 1990", []string{"ID"}, []entity.Vector{vector}, "Vector",
 		entity.L2, 10, sp)
 	if err != nil {
diff --git a/examples/hello_milvus/hello_milvus.go b/examples/hello_milvus/hello_milvus.go
index afe3825..b555e84 100644
--- a/examples/hello_milvus/hello_milvus.go
+++ b/examples/hello_milvus/hello_milvus.go
@@ -128,7 +128,7 @@ func main() {
 		entity.FloatVector(embeddingList[len(embeddingList)-1]),
 	}
 	begin := time.Now()
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	sRet, err := c.Search(ctx, collectionName, nil, "", []string{randomCol}, vec2search,
 		embeddingCol, entity.L2, topK, sp)
 	end := time.Now()
diff --git a/examples/index/index.go b/examples/index/index.go
index bfea4fb..e38ce35 100644
--- a/examples/index/index.go
+++ b/examples/index/index.go
@@ -120,7 +120,7 @@ func main() {
 
 	searchFilm := films[0] // use first fim to search
 	vector := entity.FloatVector(searchFilm.Vector[:])
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	start := time.Now()
 	sr, err := c.Search(ctx, collectionName, []string{}, "Year > 1990", []string{"ID"}, []entity.Vector{vector}, "Vector",
 		entity.L2, 10, sp)
diff --git a/examples/index/index_v2/index_v2.go b/examples/index/index_v2/index_v2.go
new file mode 100644
index 0000000..760ce43
--- /dev/null
+++ b/examples/index/index_v2/index_v2.go
@@ -0,0 +1,302 @@
+package main
+
+import (
+	"context"
+	"encoding/csv"
+	"fmt"
+	"log"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+
+	v2 "github.com/milvus-io/milvus-sdk-go/v2/client/v2"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
+)
+
+func main() {
+	// Milvus instance proxy address, may verify in your env/settings
+	milvusAddr := "localhost:19530"
+
+	// setup context for client creation, use 2 seconds here
+	ctx := context.Background()
+	ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
+	defer cancel()
+
+	c, err := v2.NewGrpcClient(ctx, milvusAddr)
+	if err != nil {
+		// handling error and exit, to make example simple here
+		log.Fatal("failed to connect to milvus:", err.Error())
+	}
+	// in a main func, remember to close the client
+	defer c.Close()
+
+	// here is the collection name we use in this example
+	collectionName := `gosdk_index_v2_example`
+
+	has, err := c.HasCollection(ctx, collectionName)
+	if err != nil {
+		log.Fatal("failed to check whether collection exists:", err.Error())
+	}
+	if has {
+		// collection with same name exist, clean up mess
+		_ = c.DropCollection(ctx, collectionName)
+	}
+
+	// define collection schema, see film.csv
+	schema := &entity.Schema{
+		CollectionName: collectionName,
+		Description:    "this is the example collection for inser and search",
+		AutoID:         false,
+		Fields: []*entity.Field{
+			{
+				Name:       "ID",
+				DataType:   entity.FieldTypeInt64, // int64 only for now
+				PrimaryKey: true,
+				AutoID:     false,
+			},
+			{
+				Name:       "Year",
+				DataType:   entity.FieldTypeInt32,
+				PrimaryKey: false,
+				AutoID:     false,
+			},
+			{
+				Name:     "Vector",
+				DataType: entity.FieldTypeFloatVector,
+				TypeParams: map[string]string{
+					entity.TypeParamDim: "8",
+				},
+			},
+		},
+	}
+
+	err = c.CreateCollection(ctx, schema, 1) // only 1 shard
+	if err != nil {
+		log.Fatal("failed to create collection:", err.Error())
+	}
+
+	films, err := loadFilmCSV()
+	if err != nil {
+		log.Fatal("failed to load film data csv:", err.Error())
+	}
+
+	// row-base covert to column-base
+	ids := make([]int64, 0, len(films))
+	years := make([]int32, 0, len(films))
+	vectors := make([][]float32, 0, len(films))
+	// string field is not supported yet
+	idTitle := make(map[int64]string)
+	for idx, film := range films {
+		ids = append(ids, film.ID)
+		idTitle[film.ID] = film.Title
+		years = append(years, film.Year)
+		vectors = append(vectors, films[idx].Vector[:]) // prevent same vector
+	}
+	idColumn := entity.NewColumnInt64("ID", ids)
+	yearColumn := entity.NewColumnInt32("Year", years)
+	vectorColumn := entity.NewColumnFloatVector("Vector", 8, vectors)
+
+	// insert into default partition
+	_, err = c.Insert(ctx, collectionName, "", idColumn, yearColumn, vectorColumn)
+	if err != nil {
+		log.Fatal("failed to insert film data:", err.Error())
+	}
+	log.Println("insert completed")
+	ctx, cancel = context.WithTimeout(context.Background(), time.Second*120)
+	defer cancel()
+	err = c.Flush(ctx, collectionName, false)
+	if err != nil {
+		log.Fatal("failed to flush collection:", err.Error())
+	}
+	log.Println("flush completed")
+
+	// Now add index
+	idx, err := entity.NewIndexFlat(entity.L2)
+	if err != nil {
+		log.Fatal("fail to create ivf flat index:", err.Error())
+	}
+	err = c.CreateIndex(ctx, false, idx, v2.SetCollectionNameForCreateIndex(collectionName),
+		v2.SetFieldNameForCreateIndex("Vector"))
+	if err != nil {
+		log.Fatal("fail to create index:", err.Error())
+	}
+	log.Println("create index completed")
+
+	// create same index
+	err = c.CreateIndex(ctx, false, idx, v2.SetCollectionNameForCreateIndex(collectionName),
+		v2.SetFieldNameForCreateIndex("Vector"))
+	if err != nil {
+		log.Fatal("fail to create index:", err.Error())
+	}
+	log.Println("create index again completed")
+
+	indexes, err := c.DescribeIndex(ctx, v2.SetCollectionNameForDescribeIndex(collectionName))
+	if err != nil {
+		log.Fatal("fail to describe index:", err.Error())
+	}
+	log.Println("describe index success, indexes: ")
+	for _, index := range indexes {
+		log.Println(index)
+	}
+
+	// load collection with async=false
+	err = c.LoadCollection(ctx, collectionName, false)
+	if err != nil {
+		log.Fatal("failed to load collection:", err.Error())
+	}
+	log.Println("load collection completed")
+
+	searchFilm := films[0] // use first fim to search
+	vector := entity.FloatVector(searchFilm.Vector[:])
+	sp, _ := entity.NewIndexFlatSearchParam()
+	start := time.Now()
+	sr, err := c.Search(ctx, collectionName, []string{}, "Year > 1990", []string{"ID"}, []entity.Vector{vector}, "Vector",
+		entity.L2, 10, sp)
+	if err != nil {
+		log.Fatal("fail to search collection:", err.Error())
+	}
+	log.Println("search without index time elapsed:", time.Since(start))
+	for _, result := range sr {
+		var idColumn *entity.ColumnInt64
+		for _, field := range result.Fields {
+			if field.Name() == "ID" {
+				c, ok := field.(*entity.ColumnInt64)
+				if ok {
+					idColumn = c
+				}
+			}
+		}
+		if idColumn == nil {
+			log.Fatal("result field not math")
+		}
+		for i := 0; i < result.ResultCount; i++ {
+			id, err := idColumn.ValueByIdx(i)
+			if err != nil {
+				log.Fatal(err.Error())
+			}
+			title := idTitle[id]
+			fmt.Printf("file id: %d title: %s scores: %f\n", id, title, result.Scores[i])
+		}
+	}
+
+	err = c.ReleaseCollection(ctx, collectionName)
+	if err != nil {
+		log.Fatal("failed to release collection:", err.Error())
+	}
+	log.Println("release collection success")
+
+	err = c.DropIndex(ctx, v2.SetCollectionNameForDropIndex(collectionName))
+	if err != nil {
+		log.Fatal("failed to drop index:", err.Error())
+	}
+	log.Println("drop index success")
+
+	log.Println("create flat index")
+	idx2, err := entity.NewIndexIvfFlat(entity.L2, 2)
+	if err != nil {
+		log.Fatal("fail to create ivf flat index:", err.Error())
+	}
+	err = c.CreateIndex(ctx, false, idx2, v2.SetCollectionNameForCreateIndex(collectionName),
+		v2.SetFieldNameForCreateIndex("Vector"))
+	if err != nil {
+		log.Fatal("fail to create index:", err.Error())
+	}
+	log.Println("create index completed")
+
+	// load collection with async=false
+	err = c.LoadCollection(ctx, collectionName, false)
+	if err != nil {
+		log.Fatal("failed to load collection:", err.Error())
+	}
+	log.Println("load collection completed")
+
+	// do search again
+	start = time.Now()
+	sp2, _ := entity.NewIndexIvfFlatSearchParam(10)
+	sr, err = c.Search(ctx, collectionName, []string{}, "Year > 1990", []string{"ID"}, []entity.Vector{vector}, "Vector",
+		entity.L2, 10, sp2)
+	if err != nil {
+		log.Fatal("fail to search collection:", err.Error())
+	}
+	log.Println("search with index time elapsed:", time.Since(start))
+
+	err = c.ReleaseCollection(ctx, collectionName)
+	if err != nil {
+		log.Fatal("failed to release collection:", err.Error())
+	}
+	log.Println("release collection success")
+
+	err = c.DropIndex(ctx, v2.SetCollectionNameForDropIndex(collectionName))
+	if err != nil {
+		log.Fatal("failed to drop index:", err.Error())
+	}
+	log.Println("drop index success")
+
+	log.Println("drop index again")
+	err = c.DropIndex(ctx, v2.SetCollectionNameForDropIndex(collectionName))
+	if err != nil {
+		log.Fatal("failed to drop index:", err.Error())
+	}
+	log.Println("drop index success")
+	// clean up
+	_ = c.DropCollection(ctx, collectionName)
+	log.Println("drop collection success")
+}
+
+type film struct {
+	ID     int64
+	Title  string
+	Year   int32
+	Vector [8]float32 // fix length array
+}
+
+func loadFilmCSV() ([]film, error) {
+	f, err := os.Open("../../films.csv") // assume you are in examples/insert folder, if not, please change the path
+	if err != nil {
+		return []film{}, err
+	}
+	r := csv.NewReader(f)
+	raw, err := r.ReadAll()
+	if err != nil {
+		return []film{}, err
+	}
+	films := make([]film, 0, len(raw))
+	for _, line := range raw {
+		if len(line) < 4 { // insuffcient column
+			continue
+		}
+		fi := film{}
+		// ID
+		v, err := strconv.ParseInt(line[0], 10, 64)
+		if err != nil {
+			continue
+		}
+		fi.ID = v
+		// Title
+		fi.Title = line[1]
+		// Year
+		v, err = strconv.ParseInt(line[2], 10, 64)
+		if err != nil {
+			continue
+		}
+		fi.Year = int32(v)
+		// Vector
+		vectorStr := strings.ReplaceAll(line[3], "[", "")
+		vectorStr = strings.ReplaceAll(vectorStr, "]", "")
+		parts := strings.Split(vectorStr, ",")
+		if len(parts) != 8 { // dim must be 8
+			continue
+		}
+		for idx, part := range parts {
+			part = strings.TrimSpace(part)
+			v, err := strconv.ParseFloat(part, 32)
+			if err != nil {
+				continue
+			}
+			fi.Vector[idx] = float32(v)
+		}
+		films = append(films, fi)
+	}
+	return films, nil
+}
diff --git a/examples/insert/insert.go b/examples/insert/insert.go
index 4d1d51a..105f632 100644
--- a/examples/insert/insert.go
+++ b/examples/insert/insert.go
@@ -121,7 +121,7 @@ func main() {
 	searchFilm := films[0] // use first fim to search
 	vector := entity.FloatVector(searchFilm.Vector[:])
 	// Use flat search param
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	sr, err := c.Search(ctx, collectionName, []string{}, "Year > 1990", []string{"ID"}, []entity.Vector{vector}, "Vector",
 		entity.L2, 10, sp)
 	if err != nil {
diff --git a/examples/query/query.go b/examples/query/query.go
index 564e6d4..a7c78f5 100644
--- a/examples/query/query.go
+++ b/examples/query/query.go
@@ -126,7 +126,7 @@ func main() {
 		entity.FloatVector(embeddingList[len(embeddingList)-1]),
 	}
 	begin := time.Now()
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	sRet, err := c.Search(ctx, collectionName, nil, "", []string{randomCol}, vec2search,
 		embeddingCol, entity.L2, topK, sp)
 	end := time.Now()
@@ -142,7 +142,7 @@ func main() {
 
 	// search with strong consistency level
 	begin = time.Now()
-	sp, _ = entity.NewIndexFlatSearchParam(10)
+	sp, _ = entity.NewIndexFlatSearchParam()
 	sRet, err = c.Search(ctx, collectionName, nil, "", []string{randomCol}, vec2search,
 		embeddingCol, entity.L2, topK, sp, client.WithSearchQueryConsistencyLevel(entity.ClStrong))
 	end = time.Now()
diff --git a/examples/tls/tls.go b/examples/tls/tls.go
index c93d0e2..7b7da7f 100644
--- a/examples/tls/tls.go
+++ b/examples/tls/tls.go
@@ -149,7 +149,7 @@ func main() {
 	searchFilm := films[0] // use first fim to search
 	vector := entity.FloatVector(searchFilm.Vector[:])
 	// Use flat search param
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	sr, err := c.Search(ctx, collectionName, []string{}, "Year > 1990", []string{"ID"}, []entity.Vector{vector}, "Vector",
 		entity.L2, 10, sp)
 	if err != nil {
diff --git a/examples/varchar/varchar_pk.go b/examples/varchar/varchar_pk.go
index 3574a43..62cfcdc 100644
--- a/examples/varchar/varchar_pk.go
+++ b/examples/varchar/varchar_pk.go
@@ -134,7 +134,7 @@ func main() {
 		entity.FloatVector(embeddingList[len(embeddingList)-1]),
 	}
 	begin := time.Now()
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	sRet, err := c.Search(ctx, collectionName, nil, "", []string{randomCol}, vec2search,
 		embeddingCol, entity.L2, topK, sp)
 	end := time.Now()


Test patch:
diff --git a/client/client_grpc_alias_test.go b/client/client_grpc_alias_test.go
index 0fbc488..29687f7 100644
--- a/client/client_grpc_alias_test.go
+++ b/client/client_grpc_alias_test.go
@@ -33,7 +33,7 @@ func TestGrpcCreateAlias(t *testing.T) {
 
 	t.Run("normal create alias", func(t *testing.T) {
 
-		mock.setInjection(mCreateAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CreateAliasRequest)
 			if !ok {
 				t.FailNow()
@@ -43,14 +43,14 @@ func TestGrpcCreateAlias(t *testing.T) {
 
 			return &common.Status{ErrorCode: common.ErrorCode_Success}, nil
 		})
-		defer mock.delInjection(mCreateAlias)
+		defer mock.DelInjection(MCreateAlias)
 		err := c.CreateAlias(ctx, "testcoll", "collAlias")
 		assert.NoError(t, err)
 	})
 
 	t.Run("alias duplicated", func(t *testing.T) {
 		m := make(map[string]struct{})
-		mock.setInjection(mCreateAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CreateAliasRequest)
 			if !ok {
 				t.FailNow()
@@ -63,7 +63,7 @@ func TestGrpcCreateAlias(t *testing.T) {
 			m[req.GetAlias()] = struct{}{}
 			return &common.Status{ErrorCode: status}, nil
 		})
-		defer mock.delInjection(mCreateAlias)
+		defer mock.DelInjection(MCreateAlias)
 
 		collName := "testColl"
 		aliasName := "collAlias"
@@ -80,7 +80,7 @@ func TestGrpcDropAlias(t *testing.T) {
 	defer c.Close()
 
 	t.Run("normal drop alias", func(t *testing.T) {
-		mock.setInjection(mDropAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDropAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.DropAliasRequest)
 			if !ok {
 				t.FailNow()
@@ -89,13 +89,13 @@ func TestGrpcDropAlias(t *testing.T) {
 
 			return &common.Status{ErrorCode: common.ErrorCode_Success}, nil
 		})
-		defer mock.delInjection(mDropAlias)
+		defer mock.DelInjection(MDropAlias)
 		err := c.DropAlias(ctx, "collAlias")
 		assert.NoError(t, err)
 	})
 
 	t.Run("drop alias error", func(t *testing.T) {
-		mock.setInjection(mDropAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDropAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.DropAliasRequest)
 			if !ok {
 				t.FailNow()
@@ -104,7 +104,7 @@ func TestGrpcDropAlias(t *testing.T) {
 
 			return &common.Status{ErrorCode: common.ErrorCode_UnexpectedError}, nil
 		})
-		defer mock.delInjection(mDropAlias)
+		defer mock.DelInjection(MDropAlias)
 		err := c.DropAlias(ctx, "collAlias")
 		assert.Error(t, err)
 	})
@@ -119,7 +119,7 @@ func TestGrpcAlterAlias(t *testing.T) {
 	aliasName := "collAlias"
 
 	t.Run("normal alter alias", func(t *testing.T) {
-		mock.setInjection(mAlterAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MAlterAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.AlterAliasRequest)
 			if !ok {
 				t.FailNow()
@@ -129,13 +129,13 @@ func TestGrpcAlterAlias(t *testing.T) {
 
 			return &common.Status{ErrorCode: common.ErrorCode_Success}, nil
 		})
-		defer mock.delInjection(mAlterAlias)
+		defer mock.DelInjection(MAlterAlias)
 		err := c.AlterAlias(ctx, collName, aliasName)
 		assert.NoError(t, err)
 	})
 
 	t.Run("alter alias error", func(t *testing.T) {
-		mock.setInjection(mAlterAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MAlterAlias, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.AlterAliasRequest)
 			if !ok {
 				t.FailNow()
@@ -145,7 +145,7 @@ func TestGrpcAlterAlias(t *testing.T) {
 
 			return &common.Status{ErrorCode: common.ErrorCode_UnexpectedError}, nil
 		})
-		defer mock.delInjection(mAlterAlias)
+		defer mock.DelInjection(MAlterAlias)
 		err := c.AlterAlias(ctx, collName, aliasName)
 		assert.Error(t, err)
 	})
diff --git a/client/client_grpc_authentication_test.go b/client/client_grpc_authentication_test.go
index 4f14e53..caf3176 100644
--- a/client/client_grpc_authentication_test.go
+++ b/client/client_grpc_authentication_test.go
@@ -16,42 +16,42 @@ func TestGrpcClient_CreateCredential(t *testing.T) {
 	c := testClient(ctx, t)
 
 	t.Run("create credential normal", func(t *testing.T) {
-		mock.setInjection(mCreateCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
-			s, err := successStatus()
+		mock.SetInjection(MCreateCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
+			s, err := SuccessStatus()
 			return s, err
 		})
-		defer mock.delInjection(mCreateCredential)
+		defer mock.DelInjection(MCreateCredential)
 		err := c.CreateCredential(ctx, testUsername, testPassword)
 		assert.Nil(t, err)
 	})
 
 	t.Run("create credential invalid name", func(t *testing.T) {
-		mock.setInjection(mCreateCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
-			s, err := badRequestStatus()
+		mock.SetInjection(MCreateCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
+			s, err := BadRequestStatus()
 			return s, err
 		})
-		defer mock.delInjection(mCreateCredential)
+		defer mock.DelInjection(MCreateCredential)
 		err := c.CreateCredential(ctx, "123", testPassword)
 		assert.Error(t, err)
 	})
 
 	t.Run("create credential grpc error", func(t *testing.T) {
-		mock.setInjection(mCreateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{}, errors.New("mocked grpc error")
 		})
-		defer mock.delInjection(mCreateCredential)
+		defer mock.DelInjection(MCreateCredential)
 		err := c.CreateCredential(ctx, testUsername, testPassword)
 		assert.Error(t, err)
 	})
 
 	t.Run("create credential server error", func(t *testing.T) {
-		mock.setInjection(mCreateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{
 				ErrorCode: common.ErrorCode_UnexpectedError,
-				Reason:    "service is not healthy",
+				Reason:    "Service is not healthy",
 			}, nil
 		})
-		defer mock.delInjection(mCreateCredential)
+		defer mock.DelInjection(MCreateCredential)
 		err := c.CreateCredential(ctx, testUsername, testPassword)
 		assert.Error(t, err)
 	})
@@ -62,32 +62,32 @@ func TestGrpcClient_UpdateCredential(t *testing.T) {
 	c := testClient(ctx, t)
 
 	t.Run("update credential normal", func(t *testing.T) {
-		mock.setInjection(mUpdateCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
-			s, err := successStatus()
+		mock.SetInjection(MUpdateCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
+			s, err := SuccessStatus()
 			return s, err
 		})
-		defer mock.delInjection(mUpdateCredential)
+		defer mock.DelInjection(MUpdateCredential)
 		err := c.UpdateCredential(ctx, testUsername, testPassword, testPassword)
 		assert.Nil(t, err)
 	})
 
 	t.Run("update credential grpc error", func(t *testing.T) {
-		mock.setInjection(mUpdateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MUpdateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{}, errors.New("mocked grpc error")
 		})
-		defer mock.delInjection(mUpdateCredential)
+		defer mock.DelInjection(MUpdateCredential)
 		err := c.UpdateCredential(ctx, testUsername, testPassword, testPassword)
 		assert.Error(t, err)
 	})
 
 	t.Run("update credential server error", func(t *testing.T) {
-		mock.setInjection(mUpdateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MUpdateCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{
 				ErrorCode: common.ErrorCode_UnexpectedError,
-				Reason:    "service is not healthy",
+				Reason:    "Service is not healthy",
 			}, nil
 		})
-		defer mock.delInjection(mUpdateCredential)
+		defer mock.DelInjection(MUpdateCredential)
 		err := c.UpdateCredential(ctx, testUsername, testPassword, testPassword)
 		assert.Error(t, err)
 	})
@@ -98,32 +98,32 @@ func TestGrpcClient_DeleteCredential(t *testing.T) {
 	c := testClient(ctx, t)
 
 	t.Run("delete credential normal", func(t *testing.T) {
-		mock.setInjection(mDeleteCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
-			s, err := successStatus()
+		mock.SetInjection(MDeleteCredential, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
+			s, err := SuccessStatus()
 			return s, err
 		})
-		defer mock.delInjection(mDeleteCredential)
+		defer mock.DelInjection(MDeleteCredential)
 		err := c.DeleteCredential(ctx, testUsername)
 		assert.Nil(t, err)
 	})
 
 	t.Run("delete credential grpc error", func(t *testing.T) {
-		mock.setInjection(mDeleteCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDeleteCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{}, errors.New("mocked grpc error")
 		})
-		defer mock.delInjection(mDeleteCredential)
+		defer mock.DelInjection(MDeleteCredential)
 		err := c.DeleteCredential(ctx, testUsername)
 		assert.Error(t, err)
 	})
 
 	t.Run("delete credential server error", func(t *testing.T) {
-		mock.setInjection(mDeleteCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDeleteCredential, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{
 				ErrorCode: common.ErrorCode_UnexpectedError,
-				Reason:    "service is not healthy",
+				Reason:    "Service is not healthy",
 			}, nil
 		})
-		defer mock.delInjection(mDeleteCredential)
+		defer mock.DelInjection(MDeleteCredential)
 		err := c.DeleteCredential(ctx, testUsername)
 		assert.Error(t, err)
 	})
@@ -134,39 +134,39 @@ func TestGrpcClient_ListCredUsers(t *testing.T) {
 	c := testClient(ctx, t)
 
 	t.Run("list credential users normal", func(t *testing.T) {
-		mock.setInjection(mListCredUsers, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
+		mock.SetInjection(MListCredUsers, func(ctx context.Context, _ proto.Message) (proto.Message, error) {
 			resp := &server.ListCredUsersResponse{
 				Usernames: []string{testUsername},
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
-		defer mock.delInjection(mListCredUsers)
+		defer mock.DelInjection(MListCredUsers)
 		names, err := c.ListCredUsers(ctx)
 		assert.Nil(t, err)
 		assert.Equal(t, []string{testUsername}, names)
 	})
 
 	t.Run("list credential users grpc error", func(t *testing.T) {
-		mock.setInjection(mListCredUsers, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MListCredUsers, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.ListCredUsersResponse{}, errors.New("mocked grpc error")
 		})
-		defer mock.delInjection(mListCredUsers)
+		defer mock.DelInjection(MListCredUsers)
 		_, err := c.ListCredUsers(ctx)
 		assert.Error(t, err)
 	})
 
 	t.Run("list credential users server error", func(t *testing.T) {
-		mock.setInjection(mListCredUsers, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MListCredUsers, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.ListCredUsersResponse{
 				Status: &common.Status{
 					ErrorCode: common.ErrorCode_UnexpectedError,
-					Reason:    "service is not healthy",
+					Reason:    "Service is not healthy",
 				},
 			}, nil
 		})
-		defer mock.delInjection(mListCredUsers)
+		defer mock.DelInjection(MListCredUsers)
 		_, err := c.ListCredUsers(ctx)
 		assert.Error(t, err)
 	})
diff --git a/client/client_grpc_collection_test.go b/client/client_grpc_collection_test.go
index 8133b07..eaccc02 100644
--- a/client/client_grpc_collection_test.go
+++ b/client/client_grpc_collection_test.go
@@ -53,8 +53,8 @@ func TestGrpcClientListCollections(t *testing.T) {
 	}
 
 	for _, tc := range cases {
-		mock.setInjection(mShowCollections, func(_ context.Context, raw proto.Message) (proto.Message, error) {
-			s, err := successStatus()
+		mock.SetInjection(MShowCollections, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+			s, err := SuccessStatus()
 			resp := &server.ShowCollectionsResponse{
 				Status:              s,
 				CollectionIds:       tc.ids,
@@ -91,11 +91,11 @@ func TestGrpcClientCreateCollection(t *testing.T) {
 	ctx := context.Background()
 	c := testClient(ctx, t)
 	// default, all collection name returns false
-	mock.delInjection(mHasCollection)
+	mock.DelInjection(MHasCollection)
 	t.Run("Test normal creation", func(t *testing.T) {
 		ds := defaultSchema()
 		shardsNum := int32(1)
-		mock.setInjection(mCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CreateCollectionRequest)
 			if !ok {
 				return &common.Status{ErrorCode: common.ErrorCode_IllegalArgument}, errors.New("illegal request type")
@@ -117,13 +117,13 @@ func TestGrpcClientCreateCollection(t *testing.T) {
 			return &common.Status{ErrorCode: common.ErrorCode_Success}, nil
 		})
 		assert.Nil(t, c.CreateCollection(ctx, ds, shardsNum))
-		mock.delInjection(mCreateCollection)
+		mock.DelInjection(MCreateCollection)
 	})
 
 	t.Run("Test create with consistency level", func(t *testing.T) {
 		ds := defaultSchema()
 		shardsNum := int32(1)
-		mock.setInjection(mCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CreateCollectionRequest)
 			if !ok {
 				return &common.Status{ErrorCode: common.ErrorCode_IllegalArgument}, errors.New("illegal request type")
@@ -134,7 +134,7 @@ func TestGrpcClientCreateCollection(t *testing.T) {
 			return &common.Status{ErrorCode: common.ErrorCode_Success}, nil
 		})
 		assert.Nil(t, c.CreateCollection(ctx, ds, shardsNum, WithConsistencyLevel(entity.ClEventually)))
-		mock.delInjection(mCreateCollection)
+		mock.DelInjection(MCreateCollection)
 	})
 
 	t.Run("Test invalid schemas", func(t *testing.T) {
@@ -222,67 +222,67 @@ func TestGrpcClientCreateCollection(t *testing.T) {
 			},
 		}
 		shardsNum := int32(1) // <= 0 will used default shards num 2, skip check
-		mock.setInjection(mCreateCollection, func(_ context.Context, _ proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(_ context.Context, _ proto.Message) (proto.Message, error) {
 			// should not be here!
 			assert.FailNow(t, "should not be here")
 			return nil, errors.New("should not be here")
 		})
 		for _, s := range cases {
 			assert.NotNil(t, c.CreateCollection(ctx, s, shardsNum))
-			mock.delInjection(mCreateCollection)
+			mock.DelInjection(MCreateCollection)
 		}
 	})
 
 	t.Run("test duplicated collection", func(t *testing.T) {
 		m := make(map[string]struct{})
-		mock.setInjection(mCreateCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CreateCollectionRequest)
 			if !ok {
-				return badRequestStatus()
+				return BadRequestStatus()
 			}
 			m[req.GetCollectionName()] = struct{}{}
 
-			return successStatus()
+			return SuccessStatus()
 		})
-		defer mock.delInjection(mCreateCollection)
-		mock.setInjection(mHasCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		defer mock.DelInjection(MCreateCollection)
+		mock.SetInjection(MHasCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.HasCollectionRequest)
 			resp := &server.BoolResponse{}
 			if !ok {
-				return badRequestStatus()
+				return BadRequestStatus()
 			}
 
 			_, has := m[req.GetCollectionName()]
 			resp.Value = has
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
-		defer mock.delInjection(mHasCollection)
+		defer mock.DelInjection(MHasCollection)
 
 		assert.Nil(t, c.CreateCollection(ctx, defaultSchema(), 1))
 		assert.NotNil(t, c.CreateCollection(ctx, defaultSchema(), 1))
 	})
 
 	t.Run("test server returns error", func(t *testing.T) {
-		mock.setInjection(mCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			_, ok := raw.(*server.CreateCollectionRequest)
 			if !ok {
-				return badRequestStatus()
+				return BadRequestStatus()
 			}
 			return &common.Status{
 				ErrorCode: common.ErrorCode_UnexpectedError,
-				Reason:    "service is not healthy",
+				Reason:    "Service is not healthy",
 			}, nil
 		})
 		assert.Error(t, c.CreateCollection(ctx, defaultSchema(), 1))
 
-		mock.setInjection(mCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{}, errors.New("mocked grpc error")
 		})
 
 		assert.Error(t, c.CreateCollection(ctx, defaultSchema(), 1))
-		mock.delInjection(mCreateCollection)
+		mock.DelInjection(MCreateCollection)
 	})
 }
 
@@ -291,12 +291,12 @@ var hasCollectionDefault = func(_ context.Context, raw proto.Message) (proto.Mes
 	req, ok := raw.(*server.HasCollectionRequest)
 	resp := &server.BoolResponse{}
 	if !ok {
-		s, err := badRequestStatus()
+		s, err := BadRequestStatus()
 		resp.Status = s
 		return s, err
 	}
 	resp.Value = req.GetCollectionName() == testCollectionName
-	s, err := successStatus()
+	s, err := SuccessStatus()
 	resp.Status = s
 	return resp, err
 }
@@ -305,16 +305,16 @@ func TestGrpcClientDropCollection(t *testing.T) {
 	ctx := context.Background()
 	c := testClient(ctx, t)
 
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mDropCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MDropCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := (raw).(*server.DropCollectionRequest)
 		if !ok {
-			return badRequestStatus()
+			return BadRequestStatus()
 		}
 		if req.GetCollectionName() != testCollectionName { // in mock server, assume testCollection exists only
-			return badRequestStatus()
+			return BadRequestStatus()
 		}
-		return successStatus()
+		return SuccessStatus()
 	})
 
 	t.Run("Test Normal drop", func(t *testing.T) {
@@ -329,15 +329,15 @@ func TestGrpcClientDropCollection(t *testing.T) {
 func TestGrpcClientLoadCollection(t *testing.T) {
 	ctx := context.Background()
 	c := testClient(ctx, t)
-	mock.setInjection(mHasCollection, hasCollectionDefault)
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
 	// injection check collection name equals
-	mock.setInjection(mLoadCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MLoadCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.LoadCollectionRequest)
 		if !ok {
-			return badRequestStatus()
+			return BadRequestStatus()
 		}
 		assert.Equal(t, testCollectionName, req.GetCollectionName())
-		return successStatus()
+		return SuccessStatus()
 	})
 	t.Run("Load collection normal async", func(t *testing.T) {
 		assert.Nil(t, c.LoadCollection(ctx, testCollectionName, true))
@@ -348,15 +348,15 @@ func TestGrpcClientLoadCollection(t *testing.T) {
 		passed := false                  // ### flag variable
 		start := time.Now()
 
-		mock.setInjection(mShowCollections, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MShowCollections, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.ShowCollectionsRequest)
 			r := &server.ShowCollectionsResponse{}
 			if !ok || req == nil {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				r.Status = s
 				return r, err
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			r.Status = s
 			r.CollectionIds = []int64{1}
 			var perc int64
@@ -378,34 +378,34 @@ func TestGrpcClientLoadCollection(t *testing.T) {
 		assert.NotNil(t, c.LoadCollection(quickCtx, testCollectionName, false))
 
 		// remove injection
-		mock.delInjection(mShowCollections)
+		mock.DelInjection(MShowCollections)
 	})
 	t.Run("Load default replica", func(t *testing.T) {
-		mock.setInjection(mLoadCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MLoadCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.LoadCollectionRequest)
 			if !ok {
-				return badRequestStatus()
+				return BadRequestStatus()
 			}
 			assert.Equal(t, testDefaultReplicaNumber, req.GetReplicaNumber())
 			assert.Equal(t, testCollectionName, req.GetCollectionName())
-			return successStatus()
+			return SuccessStatus()
 		})
-		defer mock.delInjection(mLoadCollection)
+		defer mock.DelInjection(MLoadCollection)
 		assert.Nil(t, c.LoadCollection(ctx, testCollectionName, true))
 	})
 	t.Run("Load multiple replica", func(t *testing.T) {
-		mock.delInjection(mLoadCollection)
+		mock.DelInjection(MLoadCollection)
 
-		mock.setInjection(mLoadCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MLoadCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.LoadCollectionRequest)
 			if !ok {
-				return badRequestStatus()
+				return BadRequestStatus()
 			}
 			assert.Equal(t, testMultiReplicaNumber, req.GetReplicaNumber())
 			assert.Equal(t, testCollectionName, req.GetCollectionName())
-			return successStatus()
+			return SuccessStatus()
 		})
-		defer mock.delInjection(mLoadCollection)
+		defer mock.DelInjection(MLoadCollection)
 		assert.Nil(t, c.LoadCollection(ctx, testCollectionName, true, WithReplicaNumber(testMultiReplicaNumber)))
 	})
 }
@@ -415,13 +415,13 @@ func TestReleaseCollection(t *testing.T) {
 
 	c := testClient(ctx, t)
 
-	mock.setInjection(mReleaseCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MReleaseCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.ReleaseCollectionRequest)
 		if !ok {
-			return badRequestStatus()
+			return BadRequestStatus()
 		}
 		assert.Equal(t, testCollectionName, req.GetCollectionName())
-		return successStatus()
+		return SuccessStatus()
 	})
 
 	c.ReleaseCollection(ctx, testCollectionName)
@@ -432,18 +432,18 @@ func TestGrpcClientHasCollection(t *testing.T) {
 
 	c := testClient(ctx, t)
 
-	mock.setInjection(mHasCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MHasCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.HasCollectionRequest)
 		resp := &server.BoolResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			assert.Fail(t, err.Error())
 			resp.Status = s
 			return resp, err
 		}
 		assert.Equal(t, req.CollectionName, testCollectionName)
 
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status, resp.Value = s, true
 		return resp, err
 	})
@@ -460,7 +460,7 @@ func hasCollectionInjection(t *testing.T, mustIn bool, collNames ...string) func
 		req, ok := raw.(*server.HasCollectionRequest)
 		resp := &server.BoolResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
@@ -473,7 +473,7 @@ func hasCollectionInjection(t *testing.T, mustIn bool, collNames ...string) func
 				}
 			}
 		}
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		return resp, err
 	}
@@ -484,7 +484,7 @@ func describeCollectionInjection(t *testing.T, collID int64, collName string, sc
 		req, ok := raw.(*server.DescribeCollectionRequest)
 		resp := &server.DescribeCollectionResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
@@ -495,7 +495,7 @@ func describeCollectionInjection(t *testing.T, collID int64, collName string, sc
 		resp.Schema = sch.ProtoMessage()
 		resp.CollectionID = collID
 
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 
 		return resp, err
@@ -509,7 +509,7 @@ func TestGrpcClientDescribeCollection(t *testing.T) {
 
 	collectionID := rand.Int63()
 
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, collectionID, testCollectionName, defaultSchema()))
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, collectionID, testCollectionName, defaultSchema()))
 
 	collection, err := c.DescribeCollection(ctx, testCollectionName)
 	assert.Nil(t, err)
@@ -526,16 +526,16 @@ func TestGrpcClientGetCollectionStatistics(t *testing.T) {
 	stat := make(map[string]string)
 	stat["row_count"] = "0"
 
-	mock.setInjection(mGetCollectionStatistics, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MGetCollectionStatistics, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.GetCollectionStatisticsRequest)
 		resp := &server.GetCollectionStatisticsResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
 		assert.Equal(t, testCollectionName, req.GetCollectionName())
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status, resp.Stats = s, entity.MapKvPairs(stat)
 		return resp, err
 	})
@@ -557,11 +557,11 @@ func TestGrpcClientGetReplicas(t *testing.T) {
 
 	replicaID := rand.Int63()
 	nodeIds := []int64{1, 2, 3, 4}
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	defer mock.delInjection(mHasCollection)
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	defer mock.DelInjection(MHasCollection)
 
-	mock.setInjection(mShowCollections, func(_ context.Context, raw proto.Message) (proto.Message, error) {
-		s, err := successStatus()
+	mock.SetInjection(MShowCollections, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		s, err := SuccessStatus()
 		resp := &server.ShowCollectionsResponse{
 			Status:              s,
 			CollectionIds:       []int64{testCollectionID},
@@ -570,20 +570,20 @@ func TestGrpcClientGetReplicas(t *testing.T) {
 		}
 		return resp, err
 	})
-	defer mock.delInjection(mShowCollections)
+	defer mock.DelInjection(MShowCollections)
 
-	mock.setInjection(mGetReplicas, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MGetReplicas, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.GetReplicasRequest)
 		resp := &server.GetReplicasResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
 
 		assert.Equal(t, testCollectionID, req.CollectionID)
 
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		resp.Replicas = []*server.ReplicaInfo{{
 			ReplicaID: replicaID,
@@ -619,7 +619,7 @@ func TestGrpcClientGetReplicas(t *testing.T) {
 	})
 
 	t.Run("get replicas grpc error", func(t *testing.T) {
-		mock.setInjection(mGetReplicas, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetReplicas, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.GetReplicasResponse{}, errors.New("mocked grpc error")
 		})
 		_, err := c.GetReplicas(ctx, testCollectionName)
@@ -627,11 +627,11 @@ func TestGrpcClientGetReplicas(t *testing.T) {
 	})
 
 	t.Run("get replicas server error", func(t *testing.T) {
-		mock.setInjection(mGetReplicas, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetReplicas, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.GetReplicasResponse{
 				Status: &common.Status{
 					ErrorCode: common.ErrorCode_UnexpectedError,
-					Reason:    "service is not healthy",
+					Reason:    "Service is not healthy",
 				},
 				Replicas: nil,
 			}, nil
@@ -640,5 +640,5 @@ func TestGrpcClientGetReplicas(t *testing.T) {
 		assert.Error(t, err)
 	})
 
-	mock.delInjection(mGetReplicas)
+	mock.DelInjection(MGetReplicas)
 }
diff --git a/client/client_grpc_control_test.go b/client/client_grpc_control_test.go
index 72666f8..dd93552 100644
--- a/client/client_grpc_control_test.go
+++ b/client/client_grpc_control_test.go
@@ -35,15 +35,15 @@ func TestGrpcManualCompaction(t *testing.T) {
 	c := testClient(ctx, t)
 	defer c.Close()
 
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	defer mock.delInjection(mHasCollection)
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	defer mock.DelInjection(MHasCollection)
 
 	compactionID := int64(1001)
 	t.Run("normal manual compaction", func(t *testing.T) {
 		now := time.Now()
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, defaultSchema()))
-		defer mock.delInjection(mDescribeCollection)
-		mock.setInjection(mManualCompaction, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, defaultSchema()))
+		defer mock.DelInjection(MDescribeCollection)
+		mock.SetInjection(MManualCompaction, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.ManualCompactionRequest)
 			if !ok {
 				t.FailNow()
@@ -56,11 +56,11 @@ func TestGrpcManualCompaction(t *testing.T) {
 			resp := &server.ManualCompactionResponse{
 				CompactionID: compactionID,
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
-		defer mock.delInjection(mManualCompaction)
+		defer mock.DelInjection(MManualCompaction)
 
 		id, err := c.ManualCompaction(ctx, testCollectionName, 0)
 		assert.NoError(t, err)
@@ -68,26 +68,26 @@ func TestGrpcManualCompaction(t *testing.T) {
 	})
 
 	t.Run("not ready client manual compaction", func(t *testing.T) {
-		c := grpcClient{}
+		c := GrpcClient{}
 		_, err := c.ManualCompaction(ctx, testCollectionName, 0)
 		assert.Error(t, err)
 		assert.Equal(t, ErrClientNotReady, err)
 	})
 
 	t.Run("describe collection fail", func(t *testing.T) {
-		mock.setInjection(mDescribeCollection, func(_ context.Context, _ proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDescribeCollection, func(_ context.Context, _ proto.Message) (proto.Message, error) {
 			return &server.DescribeCollectionResponse{}, errors.New("mocked error")
 		})
-		defer mock.delInjection(mDescribeCollection)
+		defer mock.DelInjection(MDescribeCollection)
 
 		_, err := c.ManualCompaction(ctx, testCollectionName, 0)
 		assert.Error(t, err)
 	})
 
-	t.Run("compaction service error", func(t *testing.T) {
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, defaultSchema()))
-		defer mock.delInjection(mDescribeCollection)
-		mock.setInjection(mManualCompaction, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+	t.Run("compaction Service error", func(t *testing.T) {
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, defaultSchema()))
+		defer mock.DelInjection(MDescribeCollection)
+		mock.SetInjection(MManualCompaction, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.ManualCompactionResponse{
 				CompactionID: 1001,
 			}
@@ -96,7 +96,7 @@ func TestGrpcManualCompaction(t *testing.T) {
 
 		_, err := c.ManualCompaction(ctx, testCollectionName, 0)
 		assert.Error(t, err)
-		mock.setInjection(mManualCompaction, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MManualCompaction, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.ManualCompactionResponse{
 				CompactionID: 1001,
 			}
@@ -106,7 +106,7 @@ func TestGrpcManualCompaction(t *testing.T) {
 			return resp, nil
 		})
 
-		defer mock.delInjection(mManualCompaction)
+		defer mock.DelInjection(MManualCompaction)
 
 		_, err = c.ManualCompaction(ctx, testCollectionName, 0)
 		assert.Error(t, err)
@@ -123,7 +123,7 @@ func TestGrpcGetCompactionState(t *testing.T) {
 	t.Run("normal get compaction state", func(t *testing.T) {
 		state := common.CompactionState_Executing
 
-		mock.setInjection(mGetCompactionState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetCompactionState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.GetCompactionStateRequest)
 			if !ok {
 				t.FailNow()
@@ -134,11 +134,11 @@ func TestGrpcGetCompactionState(t *testing.T) {
 			resp := &server.GetCompactionStateResponse{
 				State: state,
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
-		defer mock.delInjection(mGetCompactionState)
+		defer mock.DelInjection(MGetCompactionState)
 
 		result, err := c.GetCompactionState(ctx, compactionID)
 		assert.NoError(t, err)
@@ -150,15 +150,15 @@ func TestGrpcGetCompactionState(t *testing.T) {
 		assert.Equal(t, entity.CompactionStateCompleted, result)
 	})
 
-	t.Run("get compaction service fail", func(t *testing.T) {
-		mock.setInjection(mGetCompactionState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	t.Run("get compaction Service fail", func(t *testing.T) {
+		mock.SetInjection(MGetCompactionState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.GetCompactionStateResponse{}
 			resp.Status = &common.Status{
 				ErrorCode: common.ErrorCode_UnexpectedError,
 			}
 			return resp, nil
 		})
-		defer mock.delInjection(mGetCompactionState)
+		defer mock.DelInjection(MGetCompactionState)
 
 		_, err := c.GetCompactionState(ctx, compactionID)
 		assert.Error(t, err)
@@ -179,7 +179,7 @@ func TestGrpcGetCompactionStateWithPlans(t *testing.T) {
 			{Source: []int64{4, 5}, Target: 6, PlanType: entity.CompactionPlanMergeSegments},
 		}
 
-		mock.setInjection(mGetCompactionStateWithPlans, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetCompactionStateWithPlans, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.GetCompactionPlansRequest)
 			if !ok {
 				t.FailNow()
@@ -198,11 +198,11 @@ func TestGrpcGetCompactionStateWithPlans(t *testing.T) {
 				})
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
-		defer mock.delInjection(mGetCompactionStateWithPlans)
+		defer mock.DelInjection(MGetCompactionStateWithPlans)
 
 		result, rPlans, err := c.GetCompactionStateWithPlans(ctx, compactionID)
 		assert.NoError(t, err)
@@ -216,15 +216,15 @@ func TestGrpcGetCompactionStateWithPlans(t *testing.T) {
 		assert.ElementsMatch(t, plans, rPlans)
 	})
 
-	t.Run("get compaction service fail", func(t *testing.T) {
-		mock.setInjection(mGetCompactionStateWithPlans, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	t.Run("get compaction Service fail", func(t *testing.T) {
+		mock.SetInjection(MGetCompactionStateWithPlans, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.GetCompactionPlansResponse{}
 			resp.Status = &common.Status{
 				ErrorCode: common.ErrorCode_UnexpectedError,
 			}
 			return resp, nil
 		})
-		defer mock.delInjection(mGetCompactionStateWithPlans)
+		defer mock.DelInjection(MGetCompactionStateWithPlans)
 
 		_, _, err := c.GetCompactionStateWithPlans(ctx, compactionID)
 		assert.Error(t, err)
diff --git a/client/client_grpc_data_test.go b/client/client_grpc_data_test.go
index db18693..53e6809 100644
--- a/client/client_grpc_data_test.go
+++ b/client/client_grpc_data_test.go
@@ -23,19 +23,19 @@ func TestGrpcClientInsert(t *testing.T) {
 	c := testClient(ctx, t)
 
 	t.Run("test create failure due to meta", func(t *testing.T) {
-		mock.delInjection(mHasCollection) // collection does not exist
+		mock.DelInjection(MHasCollection) // collection does not exist
 		ids, err := c.Insert(ctx, testCollectionName, "")
 		assert.Nil(t, ids)
 		assert.NotNil(t, err)
 
 		// partition not exists
-		mock.setInjection(mHasCollection, hasCollectionDefault)
+		mock.SetInjection(MHasCollection, hasCollectionDefault)
 		ids, err = c.Insert(ctx, testCollectionName, "_part_not_exists")
 		assert.Nil(t, ids)
 		assert.NotNil(t, err)
 
 		// field not in collection
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 		vectors := generateFloatVector(10, testVectorDim)
 		ids, err = c.Insert(ctx, testCollectionName, "",
 			entity.NewColumnInt64("extra_field", []int64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), entity.NewColumnFloatVector(testVectorField, testVectorDim, vectors))
@@ -43,7 +43,7 @@ func TestGrpcClientInsert(t *testing.T) {
 		assert.NotNil(t, err)
 
 		// field type not match
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 		ids, err = c.Insert(ctx, testCollectionName, "",
 			entity.NewColumnInt32("int64", []int32{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), entity.NewColumnFloatVector(testVectorField, testVectorDim, vectors))
 		assert.Nil(t, ids)
@@ -73,15 +73,15 @@ func TestGrpcClientInsert(t *testing.T) {
 		assert.NotNil(t, err)
 	})
 
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 
 	vector := generateFloatVector(4096, testVectorDim)
-	mock.setInjection(mInsert, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MInsert, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.InsertRequest)
 		resp := &server.MutationResult{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
@@ -95,14 +95,14 @@ func TestGrpcClientInsert(t *testing.T) {
 		resp.IDs = &schema.IDs{
 			IdField: intIds,
 		}
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		return resp, err
 	})
 	_, err := c.Insert(ctx, testCollectionName, "", // use default partition
 		entity.NewColumnFloatVector(testVectorField, testVectorDim, vector))
 	assert.Nil(t, err)
-	mock.delInjection(mInsert)
+	mock.DelInjection(MInsert)
 }
 
 func TestGrpcClientFlush(t *testing.T) {
@@ -126,11 +126,11 @@ func TestGrpcClientFlush(t *testing.T) {
 		flushTime := 510 + rand.Intn(1500)
 		start := time.Now()
 		flag := false
-		mock.setInjection(mFlush, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MFlush, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.FlushRequest)
 			resp := &server.FlushResponse{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -141,16 +141,16 @@ func TestGrpcClientFlush(t *testing.T) {
 				Data: segments,
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
 
-		mock.setInjection(mGetFlushState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetFlushState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.GetFlushStateRequest)
 			resp := &server.GetFlushStateResponse{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -161,7 +161,7 @@ func TestGrpcClientFlush(t *testing.T) {
 				flag = true
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -182,14 +182,14 @@ func TestGrpcDeleteByPks(t *testing.T) {
 	c := testClient(ctx, t)
 	defer c.Close()
 
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 1, testCollectionName, defaultSchema()))
-	defer mock.delInjection(mDescribeCollection)
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 1, testCollectionName, defaultSchema()))
+	defer mock.DelInjection(MDescribeCollection)
 
 	t.Run("normal delete by pks", func(t *testing.T) {
 		partName := "testPart"
-		mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, true, partName))
-		defer mock.delInjection(mHasPartition)
-		mock.setInjection(mDelete, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, true, partName))
+		defer mock.DelInjection(MHasPartition)
+		mock.SetInjection(MDelete, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.DeleteRequest)
 			if !ok {
 				t.FailNow()
@@ -198,11 +198,11 @@ func TestGrpcDeleteByPks(t *testing.T) {
 			assert.Equal(t, partName, req.GetPartitionName())
 
 			resp := &server.MutationResult{}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
-		defer mock.delInjection(mDelete)
+		defer mock.DelInjection(MDelete)
 
 		err := c.DeleteByPks(ctx, testCollectionName, partName, entity.NewColumnInt64(testPrimaryField, []int64{1, 2, 3}))
 		assert.NoError(t, err)
@@ -210,8 +210,8 @@ func TestGrpcDeleteByPks(t *testing.T) {
 
 	t.Run("Bad request deletes", func(t *testing.T) {
 		partName := "testPart"
-		mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
-		defer mock.delInjection(mHasPartition)
+		mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
+		defer mock.DelInjection(MHasPartition)
 
 		// non-exist collection
 		err := c.DeleteByPks(ctx, "non-exists-collection", "", entity.NewColumnInt64("pk", []int64{}))
@@ -235,7 +235,7 @@ func TestGrpcDeleteByPks(t *testing.T) {
 	})
 
 	t.Run("delete services fail", func(t *testing.T) {
-		mock.setInjection(mDelete, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDelete, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.MutationResult{}
 			return resp, errors.New("mocked error")
 		})
@@ -243,7 +243,7 @@ func TestGrpcDeleteByPks(t *testing.T) {
 		err := c.DeleteByPks(ctx, testCollectionName, "", entity.NewColumnInt64(testPrimaryField, []int64{1}))
 		assert.Error(t, err)
 
-		mock.setInjection(mDelete, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDelete, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.MutationResult{}
 			resp.Status = &common.Status{
 				ErrorCode: common.ErrorCode_UnexpectedError,
@@ -264,7 +264,7 @@ func TestGrpcSearch(t *testing.T) {
 	vectors := generateFloatVector(4096, testVectorDim)
 
 	t.Run("search fail due to meta error", func(t *testing.T) {
-		sp, err := entity.NewIndexFlatSearchParam(10)
+		sp, err := entity.NewIndexFlatSearchParam()
 		assert.Nil(t, err)
 
 		// specify guarantee timestamp in strong consistency level
@@ -275,16 +275,16 @@ func TestGrpcSearch(t *testing.T) {
 	})
 
 	t.Run("ok search", func(t *testing.T) {
-		mock.setInjection(mHasCollection, hasCollectionDefault)
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+		mock.SetInjection(MHasCollection, hasCollectionDefault)
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 
 		expr := `int64 > 0`
 
-		mock.setInjection(mSearch, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MSearch, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.SearchRequest)
 			resp := &server.SearchResults{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -322,12 +322,12 @@ func TestGrpcSearch(t *testing.T) {
 				Topks:  []int64{10},
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
 
-		sp, err := entity.NewIndexFlatSearchParam(10)
+		sp, err := entity.NewIndexFlatSearchParam()
 		assert.Nil(t, err)
 		assert.NotNil(t, sp)
 		results, err := c.Search(ctx, testCollectionName, []string{}, expr, []string{"int64"}, []entity.Vector{entity.FloatVector(vectors[0])},
@@ -356,11 +356,11 @@ func TestGrpcQueryByPks(t *testing.T) {
 	partName := "testPart"
 
 	t.Run("normal query by pks", func(t *testing.T) {
-		mock.setInjection(mHasCollection, hasCollectionDefault)
-		mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
-		defer mock.delInjection(mHasPartition)
+		mock.SetInjection(MHasCollection, hasCollectionDefault)
+		mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
+		defer mock.DelInjection(MHasPartition)
 
-		mock.setInjection(mQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.QueryRequest)
 			if !ok {
 				t.FailNow()
@@ -371,7 +371,7 @@ func TestGrpcQueryByPks(t *testing.T) {
 			}
 
 			resp := &server.QueryResults{}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			resp.FieldsData = []*schema.FieldData{
 				{
@@ -405,7 +405,7 @@ func TestGrpcQueryByPks(t *testing.T) {
 
 			return resp, err
 		})
-		defer mock.delInjection(mQuery)
+		defer mock.DelInjection(MQuery)
 
 		columns, err := c.QueryByPks(ctx, testCollectionName, []string{partName}, entity.NewColumnInt64(testPrimaryField, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}), []string{"int64", testVectorField})
 		assert.NoError(t, err)
@@ -432,13 +432,13 @@ func TestGrpcQueryByPks(t *testing.T) {
 	})
 
 	t.Run("normal query by varchar pks", func(t *testing.T) {
-		mock.setInjection(mHasCollection, hasCollectionDefault)
-		mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
-		defer mock.delInjection(mHasPartition)
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, varCharSchema()))
-		defer mock.setInjection(mDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, defaultSchema()))
+		mock.SetInjection(MHasCollection, hasCollectionDefault)
+		mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
+		defer mock.DelInjection(MHasPartition)
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, varCharSchema()))
+		defer mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, testCollectionID, testCollectionName, defaultSchema()))
 
-		mock.setInjection(mQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.QueryRequest)
 			if !ok {
 				t.FailNow()
@@ -449,7 +449,7 @@ func TestGrpcQueryByPks(t *testing.T) {
 			}
 
 			resp := &server.QueryResults{}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			resp.FieldsData = []*schema.FieldData{
 				{
@@ -483,7 +483,7 @@ func TestGrpcQueryByPks(t *testing.T) {
 
 			return resp, err
 		})
-		defer mock.delInjection(mQuery)
+		defer mock.DelInjection(MQuery)
 
 		columns, err := c.QueryByPks(ctx, testCollectionName, []string{partName}, entity.NewColumnVarChar("varchar", []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}), []string{"varchar", testVectorField})
 		assert.NoError(t, err)
@@ -498,9 +498,9 @@ func TestGrpcQueryByPks(t *testing.T) {
 	})
 
 	t.Run("Bad request querys", func(t *testing.T) {
-		mock.setInjection(mHasCollection, hasCollectionDefault)
-		mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
-		defer mock.delInjection(mHasPartition)
+		mock.SetInjection(MHasCollection, hasCollectionDefault)
+		mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
+		defer mock.DelInjection(MHasPartition)
 
 		// non-exist collection
 		_, err := c.QueryByPks(ctx, "non-exists-collection", []string{}, entity.NewColumnInt64("pk", []int64{}), []string{})
@@ -519,12 +519,12 @@ func TestGrpcQueryByPks(t *testing.T) {
 		assert.Error(t, err)
 	})
 
-	t.Run("Query service error", func(t *testing.T) {
-		mock.setInjection(mHasCollection, hasCollectionDefault)
-		mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
-		defer mock.delInjection(mHasPartition)
+	t.Run("Query Service error", func(t *testing.T) {
+		mock.SetInjection(MHasCollection, hasCollectionDefault)
+		mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, false, partName))
+		defer mock.DelInjection(MHasPartition)
 
-		mock.setInjection(mQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			_, ok := raw.(*server.QueryRequest)
 			if !ok {
 				t.FailNow()
@@ -533,12 +533,12 @@ func TestGrpcQueryByPks(t *testing.T) {
 			resp := &server.QueryResults{}
 			return resp, errors.New("mocked error")
 		})
-		defer mock.delInjection(mQuery)
+		defer mock.DelInjection(MQuery)
 
 		_, err := c.QueryByPks(ctx, testCollectionName, []string{}, entity.NewColumnInt64(testPrimaryField, []int64{1}), []string{"*"})
 		assert.Error(t, err)
 
-		mock.setInjection(mQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			_, ok := raw.(*server.QueryRequest)
 			if !ok {
 				t.FailNow()
@@ -555,14 +555,14 @@ func TestGrpcQueryByPks(t *testing.T) {
 		_, err = c.QueryByPks(ctx, testCollectionName, []string{}, entity.NewColumnInt64(testPrimaryField, []int64{1}), []string{"*"})
 		assert.Error(t, err)
 
-		mock.setInjection(mQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			_, ok := raw.(*server.QueryRequest)
 			if !ok {
 				t.FailNow()
 			}
 
 			resp := &server.QueryResults{}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			resp.FieldsData = []*schema.FieldData{
 				{
@@ -585,14 +585,14 @@ func TestGrpcQueryByPks(t *testing.T) {
 		_, err = c.QueryByPks(ctx, testCollectionName, []string{}, entity.NewColumnInt64(testPrimaryField, []int64{1}), []string{"*"})
 		assert.Error(t, err)
 
-		mock.setInjection(mQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MQuery, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			_, ok := raw.(*server.QueryRequest)
 			if !ok {
 				t.FailNow()
 			}
 
 			resp := &server.QueryResults{}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			resp.FieldsData = []*schema.FieldData{
 				{
@@ -620,7 +620,7 @@ func TestGrpcQueryByPks(t *testing.T) {
 func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 	ctx := context.Background()
 	t.Run("bad client calls CalcDistance", func(t *testing.T) {
-		c := &grpcClient{}
+		c := &GrpcClient{}
 		r, err := c.CalcDistance(ctx, testCollectionName, []string{}, entity.L2, nil, nil)
 		assert.Nil(t, r)
 		assert.NotNil(t, err)
@@ -628,11 +628,11 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 	})
 
 	c := testClient(ctx, t)
-	mock.setInjection(mDescribeCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MDescribeCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.DescribeCollectionRequest)
 		resp := &server.DescribeCollectionResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
@@ -641,7 +641,7 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 		sch := defaultSchema()
 		resp.Schema = sch.ProtoMessage()
 
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		return resp, err
 	})
@@ -674,11 +674,11 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 	})
 
 	t.Run("valid calls", func(t *testing.T) {
-		mock.setInjection(mCalcDistance, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCalcDistance, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CalcDistanceRequest)
 			resp := &server.CalcDistanceResults{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -718,7 +718,7 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 				},
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -739,11 +739,11 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 		assert.NotNil(t, r)
 
 		// test IntDistance,
-		mock.setInjection(mCalcDistance, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCalcDistance, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CalcDistanceRequest)
 			resp := &server.CalcDistanceResults{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -783,7 +783,7 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 				},
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -793,11 +793,11 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 		assert.NotNil(t, r)
 
 		// test str id
-		mock.setInjection(mDescribeCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDescribeCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.DescribeCollectionRequest)
 			resp := &server.DescribeCollectionResponse{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -808,15 +808,15 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 			sch.Fields[0].Name = "str"
 			resp.Schema = sch.ProtoMessage()
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
-		mock.setInjection(mCalcDistance, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCalcDistance, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CalcDistanceRequest)
 			resp := &server.CalcDistanceResults{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -841,7 +841,7 @@ func TestGrpcCalcDistanceWithIDs(t *testing.T) {
 				},
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
diff --git a/client/client_grpc_index_test.go b/client/client_grpc_index_test.go
index 2197950..1ed497c 100644
--- a/client/client_grpc_index_test.go
+++ b/client/client_grpc_index_test.go
@@ -17,23 +17,23 @@ import (
 func TestGrpcClientCreateIndex(t *testing.T) {
 	ctx := context.Background()
 	c := testClient(ctx, t)
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 
 	fieldName := `vector`
-	idx, err := entity.NewIndexFlat(entity.IP, 1024)
+	idx, err := entity.NewIndexFlat(entity.IP)
 	assert.Nil(t, err)
 	if !assert.NotNil(t, idx) {
 		t.FailNow()
 	}
-	mock.setInjection(mCreateIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MCreateIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.CreateIndexRequest)
 		if !ok {
-			return badRequestStatus()
+			return BadRequestStatus()
 		}
 		assert.Equal(t, testCollectionName, req.GetCollectionName())
 		assert.Equal(t, fieldName, req.GetFieldName())
-		return successStatus()
+		return SuccessStatus()
 	})
 
 	t.Run("test async create index", func(t *testing.T) {
@@ -41,13 +41,13 @@ func TestGrpcClientCreateIndex(t *testing.T) {
 	})
 
 	t.Run("test flush err", func(t *testing.T) {
-		mock.setInjection(mFlush, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MFlush, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.FlushResponse{}
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		})
-		defer mock.delInjection(mFlush)
+		defer mock.DelInjection(MFlush)
 		assert.NotNil(t, c.CreateIndex(ctx, testCollectionName, fieldName, idx, false))
 	})
 
@@ -55,11 +55,11 @@ func TestGrpcClientCreateIndex(t *testing.T) {
 		buildTime := rand.Intn(900) + 100
 		start := time.Now()
 		flag := false
-		mock.setInjection(mGetIndexState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetIndexState, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.GetIndexStateRequest)
 			resp := &server.GetIndexStateResponse{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -71,7 +71,7 @@ func TestGrpcClientCreateIndex(t *testing.T) {
 				flag = true
 			}
 
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -79,33 +79,33 @@ func TestGrpcClientCreateIndex(t *testing.T) {
 		assert.Nil(t, c.CreateIndex(ctx, testCollectionName, fieldName, idx, false))
 		assert.True(t, flag)
 
-		mock.delInjection(mGetIndexState)
+		mock.DelInjection(MGetIndexState)
 	})
 }
 
 func TestGrpcClientDropIndex(t *testing.T) {
 	ctx := context.Background()
 	c := testClient(ctx, t)
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 	assert.Nil(t, c.DropIndex(ctx, testCollectionName, "vector"))
 }
 
 func TestGrpcClientDescribeIndex(t *testing.T) {
 	ctx := context.Background()
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 
 	c := testClient(ctx, t)
 
 	fieldName := "vector"
 
 	t.Run("normal describe index", func(t *testing.T) {
-		mock.setInjection(mDescribeIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDescribeIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.DescribeIndexRequest)
 			resp := &server.DescribeIndexResponse{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -122,7 +122,7 @@ func TestGrpcClientDescribeIndex(t *testing.T) {
 					}),
 				},
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -132,9 +132,9 @@ func TestGrpcClientDescribeIndex(t *testing.T) {
 		assert.NotNil(t, idxes)
 	})
 
-	t.Run("service return errors", func(t *testing.T) {
-		defer mock.delInjection(mDescribeIndex)
-		mock.setInjection(mDescribeIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	t.Run("Service return errors", func(t *testing.T) {
+		defer mock.DelInjection(MDescribeIndex)
+		mock.SetInjection(MDescribeIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.DescribeIndexResponse{}
 
 			return resp, errors.New("mocked error")
@@ -143,7 +143,7 @@ func TestGrpcClientDescribeIndex(t *testing.T) {
 		_, err := c.DescribeIndex(ctx, testCollectionName, fieldName)
 		assert.Error(t, err)
 
-		mock.setInjection(mDescribeIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MDescribeIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.DescribeIndexResponse{}
 			resp.Status = &common.Status{ErrorCode: common.ErrorCode_UnexpectedError}
 			return resp, nil
@@ -156,16 +156,16 @@ func TestGrpcClientDescribeIndex(t *testing.T) {
 
 func TestGrpcGetIndexBuildProgress(t *testing.T) {
 	ctx := context.Background()
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 
 	tc := testClient(ctx, t)
-	c := tc.(*grpcClient) // since GetIndexBuildProgress is not exposed
+	c := tc.(*GrpcClient) // since GetIndexBuildProgress is not exposed
 
 	t.Run("normal get index build progress", func(t *testing.T) {
 		var total, built int64
 
-		mock.setInjection(mGetIndexBuildProgress, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetIndexBuildProgress, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.GetIndexBuildProgressRequest)
 			if !ok {
 				t.FailNow()
@@ -175,7 +175,7 @@ func TestGrpcGetIndexBuildProgress(t *testing.T) {
 				TotalRows:   total,
 				IndexedRows: built,
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -188,9 +188,9 @@ func TestGrpcGetIndexBuildProgress(t *testing.T) {
 		assert.Equal(t, built, rb)
 	})
 
-	t.Run("service return errors", func(t *testing.T) {
-		defer mock.delInjection(mGetIndexBuildProgress)
-		mock.setInjection(mGetIndexBuildProgress, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	t.Run("Service return errors", func(t *testing.T) {
+		defer mock.DelInjection(MGetIndexBuildProgress)
+		mock.SetInjection(MGetIndexBuildProgress, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			_, ok := raw.(*server.GetIndexBuildProgressRequest)
 			if !ok {
 				t.FailNow()
@@ -202,7 +202,7 @@ func TestGrpcGetIndexBuildProgress(t *testing.T) {
 		_, _, err := c.GetIndexBuildProgress(ctx, testCollectionName, testVectorField)
 		assert.Error(t, err)
 
-		mock.setInjection(mGetIndexBuildProgress, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MGetIndexBuildProgress, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			_, ok := raw.(*server.GetIndexBuildProgressRequest)
 			if !ok {
 				t.FailNow()
diff --git a/client/client_grpc_partition_test.go b/client/client_grpc_partition_test.go
index bdd8bf1..1c96d2b 100644
--- a/client/client_grpc_partition_test.go
+++ b/client/client_grpc_partition_test.go
@@ -22,7 +22,7 @@ func hasPartitionInjection(t *testing.T, collName string, mustIn bool, partition
 		req, ok := raw.(*server.HasPartitionRequest)
 		resp := &server.BoolResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
@@ -36,7 +36,7 @@ func hasPartitionInjection(t *testing.T, collName string, mustIn bool, partition
 				}
 			}
 		}
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		return resp, err
 	}
@@ -49,19 +49,19 @@ func TestGrpcClientCreatePartition(t *testing.T) {
 
 	partitionName := fmt.Sprintf("_part_%d", rand.Int())
 
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mHasPartition, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MHasPartition, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.HasPartitionRequest)
 		resp := &server.BoolResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
 		assert.Equal(t, testCollectionName, req.GetCollectionName())
 		assert.Equal(t, partitionName, req.GetPartitionName())
 		resp.Value = false
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		return resp, err
 	})
@@ -73,8 +73,8 @@ func TestGrpcClientDropPartition(t *testing.T) {
 	partitionName := fmt.Sprintf("_part_%d", rand.Int())
 	ctx := context.Background()
 	c := testClient(ctx, t)
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, true, partitionName)) // injection has assertion of collName & parition name
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, true, partitionName)) // injection has assertion of collName & parition name
 	assert.Nil(t, c.DropPartition(ctx, testCollectionName, partitionName))
 }
 
@@ -82,8 +82,8 @@ func TestGrpcClientHasPartition(t *testing.T) {
 	partitionName := fmt.Sprintf("_part_%d", rand.Int())
 	ctx := context.Background()
 	c := testClient(ctx, t)
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, false, partitionName)) // injection has assertion of collName & parition name
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, false, partitionName)) // injection has assertion of collName & parition name
 
 	r, err := c.HasPartition(ctx, testCollectionName, "_default_part")
 	assert.Nil(t, err)
@@ -100,7 +100,7 @@ func getPartitionsInterception(t *testing.T, collName string, partitions ...*ent
 		req, ok := raw.(*server.ShowPartitionsRequest)
 		resp := &server.ShowPartitionsResponse{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
@@ -112,7 +112,7 @@ func getPartitionsInterception(t *testing.T, collName string, partitions ...*ent
 			resp.PartitionNames = append(resp.PartitionNames, part.Name)
 			resp.InMemoryPercentages = append(resp.InMemoryPercentages, 100)
 		}
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		return resp, err
 	}
@@ -149,7 +149,7 @@ func TestGrpcClientShowPartitions(t *testing.T) {
 		},
 	}
 	for _, tc := range cases {
-		mock.setInjection(mShowPartitions, getPartitionsInterception(t, tc.collName, tc.partitions...))
+		mock.SetInjection(MShowPartitions, getPartitionsInterception(t, tc.collName, tc.partitions...))
 		r, err := c.ShowPartitions(ctx, tc.collName)
 		if tc.shouldSuccess {
 			assert.Nil(t, err)
@@ -170,8 +170,8 @@ func TestGrpcClientLoadPartitions(t *testing.T) {
 	ctx := context.Background()
 	c := testClient(ctx, t)
 
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, true, "_part1", "_part2", "_part3", "_part4"))
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, true, "_part1", "_part2", "_part3", "_part4"))
 
 	type testCase struct {
 		collName      string
@@ -224,11 +224,11 @@ func TestGrpcClientLoadPartitions(t *testing.T) {
 		start := time.Now()
 		loadTime := rand.Intn(1500) + 100
 		loaded := false
-		mock.setInjection(mShowPartitions, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MShowPartitions, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.ShowPartitionsRequest)
 			resp := &server.ShowPartitionsResponse{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -245,7 +245,7 @@ func TestGrpcClientLoadPartitions(t *testing.T) {
 				resp.PartitionNames = append(resp.PartitionNames, part.Name)
 				resp.InMemoryPercentages = append(resp.InMemoryPercentages, perc)
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -259,7 +259,7 @@ func TestGrpcClientLoadPartitions(t *testing.T) {
 		}
 	}
 
-	t.Run("some service failed", func(t *testing.T) {
+	t.Run("some Service failed", func(t *testing.T) {
 		tc := &testCase{
 			collName: testCollectionName,
 			partitions: []*entity.Partition{
@@ -280,11 +280,11 @@ func TestGrpcClientLoadPartitions(t *testing.T) {
 		}
 
 		// paritions will not be loaded
-		mock.setInjection(mShowPartitions, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MShowPartitions, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.ShowPartitionsRequest)
 			resp := &server.ShowPartitionsResponse{}
 			if !ok {
-				s, err := badRequestStatus()
+				s, err := BadRequestStatus()
 				resp.Status = s
 				return resp, err
 			}
@@ -297,7 +297,7 @@ func TestGrpcClientLoadPartitions(t *testing.T) {
 				resp.PartitionNames = append(resp.PartitionNames, part.Name)
 				resp.InMemoryPercentages = append(resp.InMemoryPercentages, perc)
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -305,21 +305,21 @@ func TestGrpcClientLoadPartitions(t *testing.T) {
 		defer cancel()
 		assert.NotNil(t, c.LoadPartitions(quickCtx, tc.collName, tc.loadNames, false))
 
-		mock.setInjection(mShowPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MShowPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.ShowPartitionsResponse{}, errors.New("always fail")
 		})
-		defer mock.delInjection(mShowPartitions)
+		defer mock.DelInjection(MShowPartitions)
 
 		err := c.LoadPartitions(ctx, tc.collName, tc.loadNames, false)
 		assert.NotNil(t, err)
 
-		mock.setInjection(mLoadPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MLoadPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			return &common.Status{}, errors.New("has partition failed")
 		})
 		err = c.LoadPartitions(ctx, tc.collName, tc.loadNames, false)
 		assert.NotNil(t, err)
 
-		mock.setInjection(mHasPartition, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MHasPartition, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.BoolResponse{}, errors.New("has partition failed")
 		})
 		err = c.LoadPartitions(ctx, tc.collName, tc.loadNames, false)
@@ -334,17 +334,17 @@ func TestGrpcClientReleasePartitions(t *testing.T) {
 	c := testClient(ctx, t)
 
 	parts := []string{"_part1", "_part2"}
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mHasPartition, hasPartitionInjection(t, testCollectionName, true, "_part1", "_part2", "_part3", "_part4"))
-	mock.setInjection(mReleasePartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MHasPartition, hasPartitionInjection(t, testCollectionName, true, "_part1", "_part2", "_part3", "_part4"))
+	mock.SetInjection(MReleasePartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.ReleasePartitionsRequest)
 		if !ok {
-			return badRequestStatus()
+			return BadRequestStatus()
 		}
 		assert.Equal(t, testCollectionName, req.GetCollectionName())
 		assert.ElementsMatch(t, parts, req.GetPartitionNames())
 
-		return successStatus()
+		return SuccessStatus()
 	})
 
 	assert.Nil(t, c.ReleasePartitions(ctx, testCollectionName, parts))
@@ -370,20 +370,20 @@ func TestGrpcShowPartitions(t *testing.T) {
 	}
 
 	t.Run("normal show partitions", func(t *testing.T) {
-		mock.setInjection(mShowPartitions, getPartitionsInterception(t, testCollectionName, partitions...))
+		mock.SetInjection(MShowPartitions, getPartitionsInterception(t, testCollectionName, partitions...))
 		parts, err := c.ShowPartitions(ctx, testCollectionName)
 		assert.NoError(t, err)
 		assert.NotNil(t, parts)
 	})
 
 	t.Run("bad response", func(t *testing.T) {
-		mock.setInjection(mShowPartitions, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MShowPartitions, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			resp := &server.ShowPartitionsResponse{}
 			resp.PartitionIDs = make([]int64, 0, len(partitions))
 			for _, part := range partitions {
 				resp.PartitionIDs = append(resp.PartitionIDs, part.ID)
 			}
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -391,16 +391,16 @@ func TestGrpcShowPartitions(t *testing.T) {
 		assert.Error(t, err)
 	})
 
-	t.Run("service error", func(t *testing.T) {
-		mock.setInjection(mShowPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	t.Run("Service error", func(t *testing.T) {
+		mock.SetInjection(MShowPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.ShowPartitionsResponse{}, errors.New("always fail")
 		})
-		defer mock.delInjection(mShowPartitions)
+		defer mock.DelInjection(MShowPartitions)
 
 		_, err := c.ShowPartitions(ctx, testCollectionName)
 		assert.Error(t, err)
 
-		mock.setInjection(mShowPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MShowPartitions, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			return &server.ShowPartitionsResponse{
 				Status: &common.Status{ErrorCode: common.ErrorCode_UnexpectedError},
 			}, nil
diff --git a/client/client_grpc_row_test.go b/client/client_grpc_row_test.go
index 3b1813e..c484c82 100644
--- a/client/client_grpc_row_test.go
+++ b/client/client_grpc_row_test.go
@@ -30,9 +30,9 @@ func TestCreateCollectionByRow(t *testing.T) {
 		Vector []float32 `milvus:"dim:4"`
 	}
 	t.Run("Test normal creation", func(t *testing.T) {
-		mock.delInjection(mHasCollection)
+		mock.DelInjection(MHasCollection)
 		shardsNum := int32(1)
-		mock.setInjection(mCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(ctx context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CreateCollectionRequest)
 			if !ok {
 				return &common.Status{ErrorCode: common.ErrorCode_IllegalArgument}, errors.New("illegal request type")
@@ -52,25 +52,25 @@ func TestCreateCollectionByRow(t *testing.T) {
 	t.Run("Invalid cases", func(t *testing.T) {
 		//Duplicated
 		m := make(map[string]struct{})
-		mock.setInjection(mCreateCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MCreateCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.CreateCollectionRequest)
 			if !ok {
-				return badRequestStatus()
+				return BadRequestStatus()
 			}
 			m[req.GetCollectionName()] = struct{}{}
 
-			return successStatus()
+			return SuccessStatus()
 		})
-		mock.setInjection(mHasCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		mock.SetInjection(MHasCollection, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 			req, ok := raw.(*server.HasCollectionRequest)
 			resp := &server.BoolResponse{}
 			if !ok {
-				return badRequestStatus()
+				return BadRequestStatus()
 			}
 
 			_, has := m[req.GetCollectionName()]
 			resp.Value = has
-			s, err := successStatus()
+			s, err := SuccessStatus()
 			resp.Status = s
 			return resp, err
 		})
@@ -91,19 +91,19 @@ func TestInsertByRows(t *testing.T) {
 	c := testClient(ctx, t)
 
 	t.Run("test create failure due to meta", func(t *testing.T) {
-		mock.delInjection(mHasCollection) // collection does not exist
+		mock.DelInjection(MHasCollection) // collection does not exist
 		ids, err := c.InsertByRows(ctx, testCollectionName, "", []entity.Row{})
 		assert.Nil(t, ids)
 		assert.NotNil(t, err)
 
 		// partition not exists
-		mock.setInjection(mHasCollection, hasCollectionDefault)
+		mock.SetInjection(MHasCollection, hasCollectionDefault)
 		ids, err = c.InsertByRows(ctx, testCollectionName, "_part_not_exists", []entity.Row{})
 		assert.Nil(t, ids)
 		assert.NotNil(t, err)
 
 		// field not in collection
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 		type ExtraFieldRow struct {
 			entity.RowBase
 			Int64      int64 `milvus:"primary_key"`
@@ -115,7 +115,7 @@ func TestInsertByRows(t *testing.T) {
 		assert.NotNil(t, err)
 
 		// field type not match
-		mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+		mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 		type OtherFieldRow struct {
 			entity.RowBase
 			Int64  int32     `milvus:"primary_key;name:int64"`
@@ -155,15 +155,15 @@ func TestInsertByRows(t *testing.T) {
 		t.Log(err.Error())
 	})
 
-	mock.setInjection(mHasCollection, hasCollectionDefault)
-	mock.setInjection(mDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
+	mock.SetInjection(MHasCollection, hasCollectionDefault)
+	mock.SetInjection(MDescribeCollection, describeCollectionInjection(t, 0, testCollectionName, defaultSchema()))
 
 	vector := generateFloatVector(4096, testVectorDim)
-	mock.setInjection(mInsert, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+	mock.SetInjection(MInsert, func(_ context.Context, raw proto.Message) (proto.Message, error) {
 		req, ok := raw.(*server.InsertRequest)
 		resp := &server.MutationResult{}
 		if !ok {
-			s, err := badRequestStatus()
+			s, err := BadRequestStatus()
 			resp.Status = s
 			return resp, err
 		}
@@ -177,7 +177,7 @@ func TestInsertByRows(t *testing.T) {
 		resp.IDs = &schema.IDs{
 			IdField: intIds,
 		}
-		s, err := successStatus()
+		s, err := SuccessStatus()
 		resp.Status = s
 		return resp, err
 	})
diff --git a/client/client_mock_test.go b/client/client_mock_test.go
deleted file mode 100644
index 2ffcedb..0000000
--- a/client/client_mock_test.go
+++ /dev/null
@@ -1,754 +0,0 @@
-package client
-
-import (
-	"context"
-	"errors"
-	"fmt"
-	"log"
-	"math/rand"
-	"net"
-	"sync"
-	"testing"
-	"time"
-
-	"github.com/golang/protobuf/proto"
-	common "github.com/milvus-io/milvus-proto/go-api/commonpb"
-	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
-	"github.com/milvus-io/milvus-sdk-go/v2/entity"
-	"github.com/stretchr/testify/assert"
-	"google.golang.org/grpc"
-	"google.golang.org/grpc/test/bufconn"
-)
-
-// ref https://stackoverflow.com/questions/42102496/testing-a-grpc-service
-
-const (
-	bufSzie = 1024 * 1024
-)
-
-var (
-	lis  *bufconn.Listener
-	mock *mockServer
-)
-
-// TestMain establishes mock grpc server to testing client behavior
-func TestMain(m *testing.M) {
-	rand.Seed(time.Now().Unix())
-	lis = bufconn.Listen(bufSzie)
-	s := grpc.NewServer()
-	mock = &mockServer{
-		injections: make(map[serviceMethod]testInjection),
-	}
-	server.RegisterMilvusServiceServer(s, mock)
-	go func() {
-		if err := s.Serve(lis); err != nil {
-			log.Fatalf("Server exited with error: %v", err)
-		}
-	}()
-	m.Run()
-	//	lis.Close()
-}
-
-// use bufconn dialer
-func bufDialer(context.Context, string) (net.Conn, error) {
-	return lis.Dial()
-}
-
-func testClient(ctx context.Context, t *testing.T) Client {
-	c, err := NewGrpcClient(ctx, "bufnet", grpc.WithBlock(),
-		grpc.WithInsecure(), grpc.WithContextDialer(bufDialer))
-
-	if !assert.Nil(t, err) || !assert.NotNil(t, c) {
-		t.FailNow()
-	}
-	return c
-}
-
-const (
-	testCollectionName       = `test_go_sdk`
-	testCollectionID         = int64(789)
-	testPrimaryField         = `int64`
-	testVectorField          = `vector`
-	testVectorDim            = 128
-	testDefaultReplicaNumber = int32(1)
-	testMultiReplicaNumber   = int32(2)
-	testUsername             = "user"
-	testPassword             = "pwd"
-)
-
-func defaultSchema() *entity.Schema {
-	return &entity.Schema{
-		CollectionName: testCollectionName,
-		AutoID:         false,
-		Fields: []*entity.Field{
-			{
-				Name:       testPrimaryField,
-				DataType:   entity.FieldTypeInt64,
-				PrimaryKey: true,
-				AutoID:     true,
-			},
-			{
-				Name:     testVectorField,
-				DataType: entity.FieldTypeFloatVector,
-				TypeParams: map[string]string{
-					entity.TypeParamDim: fmt.Sprintf("%d", testVectorDim),
-				},
-			},
-		},
-	}
-}
-
-func varCharSchema() *entity.Schema {
-	return &entity.Schema{
-		CollectionName: testCollectionName,
-		AutoID:         false,
-		Fields: []*entity.Field{
-			{
-				Name:       "varchar",
-				DataType:   entity.FieldTypeVarChar,
-				PrimaryKey: true,
-				AutoID:     false,
-				TypeParams: map[string]string{
-					entity.TypeParamMaxLength: fmt.Sprintf("%d", 100),
-				},
-			},
-			{
-				Name:     testVectorField,
-				DataType: entity.FieldTypeFloatVector,
-				TypeParams: map[string]string{
-					entity.TypeParamDim: fmt.Sprintf("%d", testVectorDim),
-				},
-			},
-		},
-	}
-}
-
-var _ entity.Row = &defaultRow{}
-
-type defaultRow struct {
-	entity.RowBase
-	int64  int64     `milvus:"primary_key"`
-	Vector []float32 `milvus:"dim:128"`
-}
-
-func (r defaultRow) Collection() string {
-	return testCollectionName
-}
-
-var (
-	errNotImplemented = errors.New("not implemented")
-)
-
-// type alias for service method
-type serviceMethod int
-
-const (
-	mCreateCollection        serviceMethod = 101
-	mDropCollection          serviceMethod = 102
-	mHasCollection           serviceMethod = 103
-	mLoadCollection          serviceMethod = 104
-	mReleaseCollection       serviceMethod = 105
-	mDescribeCollection      serviceMethod = 106
-	mListCollection          serviceMethod = 107
-	mGetCollectionStatistics serviceMethod = 108
-	mAlterCollection         serviceMethod = 109
-	mGetLoadingProgress      serviceMethod = 110
-
-	mCreatePartition   serviceMethod = 201
-	mDropPartition     serviceMethod = 202
-	mHasPartition      serviceMethod = 203
-	mLoadPartitions    serviceMethod = 204
-	mReleasePartitions serviceMethod = 205
-	mShowPartitions    serviceMethod = 206
-
-	mShowCollections serviceMethod = 301
-	mCreateAlias     serviceMethod = 302
-	mDropAlias       serviceMethod = 303
-	mAlterAlias      serviceMethod = 304
-	mGetReplicas     serviceMethod = 305
-
-	mCreateIndex           serviceMethod = 401
-	mDropIndex             serviceMethod = 402
-	mDescribeIndex         serviceMethod = 403
-	mGetIndexState         serviceMethod = 404
-	mGetIndexBuildProgress serviceMethod = 405
-
-	mCreateCredential serviceMethod = 500
-	mUpdateCredential serviceMethod = 501
-	mDeleteCredential serviceMethod = 502
-	mListCredUsers    serviceMethod = 503
-
-	mInsert        serviceMethod = 600
-	mFlush         serviceMethod = 601
-	mSearch        serviceMethod = 602
-	mCalcDistance  serviceMethod = 603
-	mGetFlushState serviceMethod = 604
-	mDelete        serviceMethod = 605
-	mQuery         serviceMethod = 606
-
-	mManualCompaction            serviceMethod = 700
-	mGetCompactionState          serviceMethod = 701
-	mGetCompactionStateWithPlans serviceMethod = 702
-
-	mGetPersistentSegmentInfo serviceMethod = 800
-	mGetQuerySegmentInfo      serviceMethod = 801
-
-	mGetComponentStates serviceMethod = 900
-	mGetVersion         serviceMethod = 901
-	mCheckHealth        serviceMethod = 902
-)
-
-// injection function definition
-type testInjection func(context.Context, proto.Message) (proto.Message, error)
-
-// mock Milvus Server
-type mockServer struct {
-	sync.RWMutex
-	injections map[serviceMethod]testInjection
-}
-
-func (m *mockServer) setInjection(n serviceMethod, f testInjection) {
-	m.Lock()
-	defer m.Unlock()
-	if m.injections != nil {
-		m.injections[n] = f
-	}
-}
-
-func (m *mockServer) getInjection(n serviceMethod) testInjection {
-	if m.injections == nil {
-		return nil
-	}
-	m.RLock()
-	defer m.RUnlock()
-	return m.injections[n]
-}
-
-func (m *mockServer) delInjection(n serviceMethod) {
-	if m.injections == nil {
-		return
-	}
-	m.Lock()
-	defer m.Unlock()
-	delete(m.injections, n)
-}
-
-func (m *mockServer) CreateCollection(ctx context.Context, req *server.CreateCollectionRequest) (*common.Status, error) {
-	f := m.getInjection(mCreateCollection)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) DropCollection(ctx context.Context, req *server.DropCollectionRequest) (*common.Status, error) {
-	f := m.getInjection(mDropCollection)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-
-	return successStatus()
-}
-
-func (m *mockServer) HasCollection(ctx context.Context, req *server.HasCollectionRequest) (*server.BoolResponse, error) {
-	f := m.getInjection(mHasCollection)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.BoolResponse), err
-	}
-	s, err := successStatus()
-	return &server.BoolResponse{Status: s, Value: false}, err
-}
-
-func (m *mockServer) LoadCollection(ctx context.Context, req *server.LoadCollectionRequest) (*common.Status, error) {
-	f := m.getInjection(mLoadCollection)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) ReleaseCollection(ctx context.Context, req *server.ReleaseCollectionRequest) (*common.Status, error) {
-	f := m.getInjection(mReleaseCollection)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) DescribeCollection(ctx context.Context, req *server.DescribeCollectionRequest) (*server.DescribeCollectionResponse, error) {
-	f := m.getInjection(mDescribeCollection)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.DescribeCollectionResponse), err
-	}
-	r := &server.DescribeCollectionResponse{}
-	s, err := successStatus()
-	r.Status = s
-	return r, err
-}
-
-func (m *mockServer) GetCollectionStatistics(ctx context.Context, req *server.GetCollectionStatisticsRequest) (*server.GetCollectionStatisticsResponse, error) {
-	f := m.getInjection(mGetCollectionStatistics)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetCollectionStatisticsResponse), err
-	}
-	r := &server.GetCollectionStatisticsResponse{}
-	s, err := successStatus()
-	r.Status = s
-	return r, err
-}
-
-func (m *mockServer) ShowCollections(ctx context.Context, req *server.ShowCollectionsRequest) (*server.ShowCollectionsResponse, error) {
-	f := m.getInjection(mShowCollections)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.ShowCollectionsResponse), err
-	}
-	s, err := successStatus()
-	return &server.ShowCollectionsResponse{Status: s}, err
-}
-
-func (m *mockServer) AlterCollection(ctx context.Context, req *server.AlterCollectionRequest) (*common.Status, error) {
-	f := m.getInjection(mAlterCollection)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) CreatePartition(ctx context.Context, req *server.CreatePartitionRequest) (*common.Status, error) {
-	f := m.getInjection(mCreatePartition)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-
-}
-
-func (m *mockServer) DropPartition(ctx context.Context, req *server.DropPartitionRequest) (*common.Status, error) {
-	f := m.getInjection(mDropPartition)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) HasPartition(ctx context.Context, req *server.HasPartitionRequest) (*server.BoolResponse, error) {
-	f := m.getInjection(mHasPartition)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.BoolResponse), err
-	}
-	s, err := successStatus()
-	return &server.BoolResponse{Status: s, Value: false}, err
-}
-
-func (m *mockServer) LoadPartitions(ctx context.Context, req *server.LoadPartitionsRequest) (*common.Status, error) {
-	f := m.getInjection(mLoadPartitions)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) ReleasePartitions(ctx context.Context, req *server.ReleasePartitionsRequest) (*common.Status, error) {
-	f := m.getInjection(mReleasePartitions)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) GetPartitionStatistics(_ context.Context, _ *server.GetPartitionStatisticsRequest) (*server.GetPartitionStatisticsResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) ShowPartitions(ctx context.Context, req *server.ShowPartitionsRequest) (*server.ShowPartitionsResponse, error) {
-	f := m.getInjection(mShowPartitions)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.ShowPartitionsResponse), err
-	}
-	s, err := successStatus()
-	return &server.ShowPartitionsResponse{Status: s}, err
-}
-
-func (m *mockServer) GetLoadingProgress(ctx context.Context, req *server.GetLoadingProgressRequest) (*server.GetLoadingProgressResponse, error) {
-	f := m.getInjection(mGetLoadingProgress)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetLoadingProgressResponse), err
-	}
-	s, err := successStatus()
-	return &server.GetLoadingProgressResponse{Status: s}, err
-}
-
-func (m *mockServer) CreateIndex(ctx context.Context, req *server.CreateIndexRequest) (*common.Status, error) {
-	f := m.getInjection(mCreateIndex)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) DescribeIndex(ctx context.Context, req *server.DescribeIndexRequest) (*server.DescribeIndexResponse, error) {
-	f := m.getInjection(mDescribeIndex)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.DescribeIndexResponse), err
-	}
-	s, err := successStatus()
-	return &server.DescribeIndexResponse{Status: s}, err
-}
-
-func (m *mockServer) GetIndexState(ctx context.Context, req *server.GetIndexStateRequest) (*server.GetIndexStateResponse, error) {
-	f := m.getInjection(mGetIndexState)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetIndexStateResponse), err
-	}
-	s, err := successStatus()
-	return &server.GetIndexStateResponse{Status: s}, err
-
-}
-
-func (m *mockServer) GetIndexBuildProgress(ctx context.Context, req *server.GetIndexBuildProgressRequest) (*server.GetIndexBuildProgressResponse, error) {
-	f := m.getInjection(mGetIndexBuildProgress)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetIndexBuildProgressResponse), err
-	}
-	s, err := successStatus()
-	return &server.GetIndexBuildProgressResponse{Status: s}, err
-
-}
-
-func (m *mockServer) DropIndex(ctx context.Context, req *server.DropIndexRequest) (*common.Status, error) {
-	f := m.getInjection(mDropIndex)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) Insert(ctx context.Context, req *server.InsertRequest) (*server.MutationResult, error) {
-	f := m.getInjection(mInsert)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.MutationResult), err
-	}
-	s, err := successStatus()
-	return &server.MutationResult{Status: s}, err
-}
-
-func (m *mockServer) Search(ctx context.Context, req *server.SearchRequest) (*server.SearchResults, error) {
-	f := m.getInjection(mSearch)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.SearchResults), err
-	}
-	s, err := successStatus()
-	return &server.SearchResults{Status: s}, err
-}
-
-func (m *mockServer) Flush(ctx context.Context, req *server.FlushRequest) (*server.FlushResponse, error) {
-	f := m.getInjection(mFlush)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.FlushResponse), err
-	}
-	s, err := successStatus()
-	return &server.FlushResponse{Status: s}, err
-}
-
-func (m *mockServer) Query(ctx context.Context, req *server.QueryRequest) (*server.QueryResults, error) {
-	f := m.getInjection(mQuery)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.QueryResults), err
-	}
-	s, err := successStatus()
-	return &server.QueryResults{Status: s}, err
-}
-
-func (m *mockServer) GetPersistentSegmentInfo(ctx context.Context, req *server.GetPersistentSegmentInfoRequest) (*server.GetPersistentSegmentInfoResponse, error) {
-	f := m.getInjection(mGetPersistentSegmentInfo)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetPersistentSegmentInfoResponse), err
-	}
-	s, err := successStatus()
-	return &server.GetPersistentSegmentInfoResponse{Status: s}, err
-}
-
-func (m *mockServer) GetQuerySegmentInfo(ctx context.Context, req *server.GetQuerySegmentInfoRequest) (*server.GetQuerySegmentInfoResponse, error) {
-	f := m.getInjection(mGetQuerySegmentInfo)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetQuerySegmentInfoResponse), err
-	}
-	s, err := successStatus()
-	return &server.GetQuerySegmentInfoResponse{Status: s}, err
-}
-
-func (m *mockServer) Dummy(_ context.Context, _ *server.DummyRequest) (*server.DummyResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-// TODO: remove
-func (m *mockServer) RegisterLink(_ context.Context, _ *server.RegisterLinkRequest) (*server.RegisterLinkResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) CalcDistance(ctx context.Context, req *server.CalcDistanceRequest) (*server.CalcDistanceResults, error) {
-	f := m.getInjection(mCalcDistance)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.CalcDistanceResults), err
-	}
-	resp := &server.CalcDistanceResults{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-func (m *mockServer) Delete(ctx context.Context, req *server.DeleteRequest) (*server.MutationResult, error) {
-	f := m.getInjection(mDelete)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.MutationResult), err
-	}
-	resp := &server.MutationResult{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-// https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
-func (m *mockServer) GetMetrics(_ context.Context, _ *server.GetMetricsRequest) (*server.GetMetricsResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) CreateAlias(ctx context.Context, req *server.CreateAliasRequest) (*common.Status, error) {
-	f := m.getInjection(mCreateAlias)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) DropAlias(ctx context.Context, req *server.DropAliasRequest) (*common.Status, error) {
-	f := m.getInjection(mDropAlias)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) AlterAlias(ctx context.Context, req *server.AlterAliasRequest) (*common.Status, error) {
-	f := m.getInjection(mAlterAlias)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-
-	return successStatus()
-}
-
-func (m *mockServer) GetFlushState(ctx context.Context, req *server.GetFlushStateRequest) (*server.GetFlushStateResponse, error) {
-	f := m.getInjection(mGetFlushState)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetFlushStateResponse), err
-	}
-
-	resp := &server.GetFlushStateResponse{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-func (m *mockServer) LoadBalance(_ context.Context, _ *server.LoadBalanceRequest) (*common.Status, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) GetCompactionState(ctx context.Context, req *server.GetCompactionStateRequest) (*server.GetCompactionStateResponse, error) {
-	f := m.getInjection(mGetCompactionState)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetCompactionStateResponse), err
-	}
-
-	resp := &server.GetCompactionStateResponse{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-func (m *mockServer) ManualCompaction(ctx context.Context, req *server.ManualCompactionRequest) (*server.ManualCompactionResponse, error) {
-	f := m.getInjection(mManualCompaction)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.ManualCompactionResponse), err
-	}
-	resp := &server.ManualCompactionResponse{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-func (m *mockServer) GetCompactionStateWithPlans(ctx context.Context, req *server.GetCompactionPlansRequest) (*server.GetCompactionPlansResponse, error) {
-	f := m.getInjection(mGetCompactionStateWithPlans)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetCompactionPlansResponse), err
-	}
-
-	resp := &server.GetCompactionPlansResponse{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-func (m *mockServer) GetReplicas(ctx context.Context, req *server.GetReplicasRequest) (*server.GetReplicasResponse, error) {
-	f := m.getInjection(mGetReplicas)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetReplicasResponse), err
-	}
-	resp := &server.GetReplicasResponse{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-// https://wiki.lfaidata.foundation/display/MIL/MEP+24+--+Support+bulk+load
-func (m *mockServer) Import(_ context.Context, _ *server.ImportRequest) (*server.ImportResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) GetImportState(_ context.Context, _ *server.GetImportStateRequest) (*server.GetImportStateResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) ListImportTasks(_ context.Context, _ *server.ListImportTasksRequest) (*server.ListImportTasksResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-// https://wiki.lfaidata.foundation/display/MIL/MEP+27+--+Support+Basic+Authentication
-func (m *mockServer) CreateCredential(ctx context.Context, req *server.CreateCredentialRequest) (*common.Status, error) {
-	f := m.getInjection(mCreateCredential)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) UpdateCredential(ctx context.Context, req *server.UpdateCredentialRequest) (*common.Status, error) {
-	f := m.getInjection(mUpdateCredential)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) DeleteCredential(ctx context.Context, req *server.DeleteCredentialRequest) (*common.Status, error) {
-	f := m.getInjection(mDeleteCredential)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*common.Status), err
-	}
-	return successStatus()
-}
-
-func (m *mockServer) ListCredUsers(ctx context.Context, req *server.ListCredUsersRequest) (*server.ListCredUsersResponse, error) {
-	f := m.getInjection(mListCredUsers)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.ListCredUsersResponse), err
-	}
-	resp := &server.ListCredUsersResponse{}
-	s, err := successStatus()
-	resp.Status = s
-	return resp, err
-}
-
-// https://wiki.lfaidata.foundation/display/MIL/MEP+29+--+Support+Role-Based+Access+Control
-func (m *mockServer) CreateRole(_ context.Context, _ *server.CreateRoleRequest) (*common.Status, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) DropRole(_ context.Context, _ *server.DropRoleRequest) (*common.Status, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) OperateUserRole(_ context.Context, _ *server.OperateUserRoleRequest) (*common.Status, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) SelectRole(_ context.Context, _ *server.SelectRoleRequest) (*server.SelectRoleResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) SelectUser(_ context.Context, _ *server.SelectUserRequest) (*server.SelectUserResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) OperatePrivilege(_ context.Context, _ *server.OperatePrivilegeRequest) (*common.Status, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *mockServer) SelectGrant(_ context.Context, _ *server.SelectGrantRequest) (*server.SelectGrantResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-//func (m *mockServer) DescribePartition(ctx context.Context, req *server.DescribePartitionRequest) (*server.DescribePartitionResponse, error) {
-//	panic("not implemented") // TODO: Implement
-//}
-
-func (m *mockServer) GetComponentStates(ctx context.Context, req *server.GetComponentStatesRequest) (*server.ComponentStates, error) {
-	f := m.getInjection(mGetComponentStates)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.ComponentStates), err
-	}
-	s, err := successStatus()
-	return &server.ComponentStates{Status: s}, err
-}
-
-func (m *mockServer) GetVersion(ctx context.Context, req *server.GetVersionRequest) (*server.GetVersionResponse, error) {
-	f := m.getInjection(mGetVersion)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.GetVersionResponse), err
-	}
-	s, err := successStatus()
-	return &server.GetVersionResponse{Status: s}, err
-}
-
-func (m *mockServer) CheckHealth(ctx context.Context, req *server.CheckHealthRequest) (*server.CheckHealthResponse, error) {
-	f := m.getInjection(mCheckHealth)
-	if f != nil {
-		r, err := f(ctx, req)
-		return r.(*server.CheckHealthResponse), err
-	}
-	s, err := successStatus()
-	return &server.CheckHealthResponse{Status: s}, err
-}
diff --git a/client/client_test.go b/client/client_test.go
index 20900db..979b4bd 100644
--- a/client/client_test.go
+++ b/client/client_test.go
@@ -2,27 +2,142 @@ package client
 
 import (
 	"context"
-	"errors"
 	"fmt"
 	"log"
+	"math/rand"
 	"net"
 	"reflect"
 	"strings"
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"google.golang.org/grpc"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/examples/helloworld/helloworld"
 	"google.golang.org/grpc/keepalive"
 	"google.golang.org/grpc/reflection"
 	"google.golang.org/grpc/status"
+	"google.golang.org/grpc/test/bufconn"
 
 	common "github.com/milvus-io/milvus-proto/go-api/commonpb"
+	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
 	"github.com/milvus-io/milvus-sdk-go/v2/entity"
-	"github.com/stretchr/testify/assert"
-	"google.golang.org/grpc"
 )
 
+const (
+	bufSzie = 1024 * 1024
+)
+
+var (
+	lis  *bufconn.Listener
+	mock *MockServer
+)
+
+const (
+	testCollectionName       = `test_go_sdk`
+	testCollectionID         = int64(789)
+	testPrimaryField         = `int64`
+	testVectorField          = `vector`
+	testVectorDim            = 128
+	testDefaultReplicaNumber = int32(1)
+	testMultiReplicaNumber   = int32(2)
+	testUsername             = "user"
+	testPassword             = "pwd"
+)
+
+func defaultSchema() *entity.Schema {
+	return &entity.Schema{
+		CollectionName: testCollectionName,
+		AutoID:         false,
+		Fields: []*entity.Field{
+			{
+				Name:       testPrimaryField,
+				DataType:   entity.FieldTypeInt64,
+				PrimaryKey: true,
+				AutoID:     true,
+			},
+			{
+				Name:     testVectorField,
+				DataType: entity.FieldTypeFloatVector,
+				TypeParams: map[string]string{
+					entity.TypeParamDim: fmt.Sprintf("%d", testVectorDim),
+				},
+			},
+		},
+	}
+}
+
+func varCharSchema() *entity.Schema {
+	return &entity.Schema{
+		CollectionName: testCollectionName,
+		AutoID:         false,
+		Fields: []*entity.Field{
+			{
+				Name:       "varchar",
+				DataType:   entity.FieldTypeVarChar,
+				PrimaryKey: true,
+				AutoID:     false,
+				TypeParams: map[string]string{
+					entity.TypeParamMaxLength: fmt.Sprintf("%d", 100),
+				},
+			},
+			{
+				Name:     testVectorField,
+				DataType: entity.FieldTypeFloatVector,
+				TypeParams: map[string]string{
+					entity.TypeParamDim: fmt.Sprintf("%d", testVectorDim),
+				},
+			},
+		},
+	}
+}
+
+var _ entity.Row = &defaultRow{}
+
+type defaultRow struct {
+	entity.RowBase
+	int64  int64     `milvus:"primary_key"`
+	Vector []float32 `milvus:"dim:128"`
+}
+
+func (r defaultRow) Collection() string {
+	return testCollectionName
+}
+
+// TestMain establishes mock grpc server to testing client behavior
+func TestMain(m *testing.M) {
+	rand.Seed(time.Now().Unix())
+	lis = bufconn.Listen(bufSzie)
+	s := grpc.NewServer()
+	mock = &MockServer{
+		Injections: make(map[ServiceMethod]TestInjection),
+	}
+	server.RegisterMilvusServiceServer(s, mock)
+	go func() {
+		if err := s.Serve(lis); err != nil {
+			log.Fatalf("Server exited with error: %v", err)
+		}
+	}()
+	m.Run()
+	//	lis.Close()
+}
+
+// use bufconn dialer
+func bufDialer(context.Context, string) (net.Conn, error) {
+	return lis.Dial()
+}
+
+func testClient(ctx context.Context, t *testing.T) Client {
+	c, err := NewGrpcClient(ctx, "bufnet", grpc.WithBlock(),
+		grpc.WithInsecure(), grpc.WithContextDialer(bufDialer))
+
+	if !assert.Nil(t, err) || !assert.NotNil(t, c) {
+		t.FailNow()
+	}
+	return c
+}
+
 func TestHandleRespStatus(t *testing.T) {
 	assert.NotNil(t, handleRespStatus(nil))
 	assert.Nil(t, handleRespStatus(&common.Status{
@@ -46,7 +161,7 @@ type ValidStruct struct {
 }
 
 func TestGrpcClientNil(t *testing.T) {
-	c := &grpcClient{}
+	c := &GrpcClient{}
 	tp := reflect.TypeOf(c)
 	v := reflect.ValueOf(c)
 	ctx := context.Background()
@@ -207,7 +322,7 @@ func TestGrpcClientRetryPolicy(t *testing.T) {
 	assert.Nil(t, err)
 	defer client.Close()
 
-	greeterClient := helloworld.NewGreeterClient(client.(*grpcClient).conn)
+	greeterClient := helloworld.NewGreeterClient(client.(*GrpcClient).Conn)
 	ctx := context.Background()
 	name := fmt.Sprintf("hello world %d", time.Now().Second())
 	res, err := greeterClient.SayHello(ctx, &helloworld.HelloRequest{Name: name})
@@ -224,11 +339,3 @@ func TestClient_getDefaultAuthOpts(t *testing.T) {
 	defaultOpts = getDefaultAuthOpts(username, password, false)
 	assert.True(t, len(defaultOpts) == 6)
 }
-
-func successStatus() (*common.Status, error) {
-	return &common.Status{ErrorCode: common.ErrorCode_Success}, nil
-}
-
-func badRequestStatus() (*common.Status, error) {
-	return &common.Status{ErrorCode: common.ErrorCode_IllegalArgument}, errors.New("illegal request type")
-}
diff --git a/client/v2/client_grpc_index_test.go b/client/v2/client_grpc_index_test.go
new file mode 100644
index 0000000..56e195c
--- /dev/null
+++ b/client/v2/client_grpc_index_test.go
@@ -0,0 +1,470 @@
+// Copyright (C) 2019-2021 Zilliz. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software distributed under the License
+// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+// or implied. See the License for the specific language governing permissions and limitations under the License.
+
+package v2
+
+import (
+	"context"
+	"errors"
+	"log"
+	"math/rand"
+	"net"
+	"testing"
+	"time"
+
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/test/bufconn"
+
+	"github.com/golang/protobuf/proto"
+	common "github.com/milvus-io/milvus-proto/go-api/commonpb"
+	server "github.com/milvus-io/milvus-proto/go-api/milvuspb"
+	"github.com/milvus-io/milvus-sdk-go/v2/client"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
+	"github.com/stretchr/testify/assert"
+)
+
+const (
+	bufSzie = 1024 * 1024
+)
+
+var (
+	lis  *bufconn.Listener
+	mock *client.MockServer
+)
+
+// TestMain establishes mock grpc server to testing client behavior
+func TestMain(m *testing.M) {
+	rand.Seed(time.Now().Unix())
+	lis = bufconn.Listen(bufSzie)
+	s := grpc.NewServer()
+	mock = &client.MockServer{
+		Injections: make(map[client.ServiceMethod]client.TestInjection),
+	}
+	server.RegisterMilvusServiceServer(s, mock)
+	go func() {
+		if err := s.Serve(lis); err != nil {
+			log.Fatalf("Server exited with error: %v", err)
+		}
+	}()
+	m.Run()
+	//	lis.Close()
+}
+
+// use bufconn dialer
+func bufDialer(context.Context, string) (net.Conn, error) {
+	return lis.Dial()
+}
+
+func testClient(ctx context.Context, t *testing.T) Client {
+	c, err := NewGrpcClient(ctx, "bufnet", grpc.WithBlock(),
+		grpc.WithInsecure(), grpc.WithContextDialer(bufDialer))
+
+	if !assert.Nil(t, err) || !assert.NotNil(t, c) {
+		t.FailNow()
+	}
+	return c
+}
+
+func TestGrpcClient_CreateIndex(t *testing.T) {
+	ctx := context.Background()
+	c := testClient(ctx, t)
+
+	const (
+		collectionName   = "coll_index"
+		defaultIndexName = "_default_idx_101"
+		indexName        = "indexName"
+		emptyIndexName   = ""
+		fieldName        = "fieldName"
+	)
+
+	var (
+		flag  = false
+		count = 0
+	)
+
+	idx, err := entity.NewIndexHNSW(entity.L2, 16, 64)
+	assert.Nil(t, err)
+	if !assert.NotNil(t, idx) {
+		t.FailNow()
+	}
+	mock.SetInjection(client.MCreateIndex, func(_ context.Context, raw proto.Message) (proto.Message, error) {
+		req, ok := raw.(*server.CreateIndexRequest)
+		if !ok {
+			return client.BadRequestStatus()
+		}
+		assert.Equal(t, collectionName, req.GetCollectionName())
+		assert.Equal(t, fieldName, req.GetFieldName())
+		//assert.Equal(t, defaultIndexName, req.GetIndexName())
+		return client.SuccessStatus()
+	})
+
+	mock.SetInjection(client.MDescribeIndex, func(_ context.Context, message proto.Message) (proto.Message, error) {
+		var err2 error
+		req, ok := message.(*server.DescribeIndexRequest)
+		resp := &server.DescribeIndexResponse{}
+		if !ok {
+			resp.Status, err2 = client.BadRequestStatus()
+			return resp.Status, err2
+		}
+		assert.Equal(t, collectionName, req.GetCollectionName())
+		assert.Equal(t, fieldName, req.GetFieldName())
+		//assert.Equal(t, defaultIndexName, req.GetIndexName())
+
+		count++
+
+		if req.GetIndexName() == emptyIndexName {
+			resp.IndexDescriptions = []*server.IndexDescription{
+				{
+					IndexName:            defaultIndexName,
+					IndexID:              1,
+					Params:               entity.MapKvPairs(idx.Params()),
+					FieldName:            req.GetFieldName(),
+					IndexedRows:          9000,
+					TotalRows:            10000,
+					State:                common.IndexState_InProgress,
+					IndexStateFailReason: "",
+				},
+				{
+					IndexName:            indexName,
+					IndexID:              2,
+					Params:               entity.MapKvPairs(idx.Params()),
+					FieldName:            req.GetFieldName(),
+					IndexedRows:          2500,
+					TotalRows:            3000,
+					State:                common.IndexState_InProgress,
+					IndexStateFailReason: "",
+				},
+			}
+		} else {
+			resp.IndexDescriptions = []*server.IndexDescription{
+				{
+					IndexName:            req.GetIndexName(),
+					IndexID:              0,
+					Params:               entity.MapKvPairs(idx.Params()),
+					FieldName:            req.GetFieldName(),
+					IndexedRows:          9000,
+					TotalRows:            10000,
+					State:                common.IndexState_InProgress,
+					IndexStateFailReason: "",
+				},
+			}
+		}
+
+		if count >= 10 {
+			for i := range resp.GetIndexDescriptions() {
+				resp.IndexDescriptions[i].State = common.IndexState_Finished
+			}
+			flag = true
+		}
+
+		resp.Status, err2 = client.SuccessStatus()
+		return resp, err2
+	})
+
+	t.Run("normal", func(t *testing.T) {
+		err = c.CreateIndex(ctx, true, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.NoError(t, err)
+	})
+
+	t.Run("sync mode", func(t *testing.T) {
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.NoError(t, err)
+		assert.True(t, flag)
+	})
+
+	t.Run("empty collection name", func(t *testing.T) {
+		err = c.CreateIndex(ctx, false, idx,
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.Error(t, err)
+	})
+
+	t.Run("empty field name", func(t *testing.T) {
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetIndexNameForCreateIndex(defaultIndexName))
+		assert.Error(t, err)
+	})
+
+	t.Run("empty index name", func(t *testing.T) {
+		count = 0
+		flag = false
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName))
+		assert.NoError(t, err)
+		assert.True(t, flag)
+	})
+
+	t.Run("index failed", func(t *testing.T) {
+		mock.SetInjection(client.MDescribeIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			var err2 error
+			req, ok := message.(*server.DescribeIndexRequest)
+			resp := &server.DescribeIndexResponse{}
+			if !ok {
+				resp.Status, err2 = client.BadRequestStatus()
+				return resp, err2
+			}
+			resp.IndexDescriptions = []*server.IndexDescription{
+				{
+					IndexName:            req.GetIndexName(),
+					IndexID:              1,
+					Params:               nil,
+					FieldName:            req.GetFieldName(),
+					IndexedRows:          1000,
+					TotalRows:            0,
+					State:                common.IndexState_Failed,
+					IndexStateFailReason: "",
+				},
+			}
+			return resp, err2
+		})
+
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.Error(t, err)
+	})
+
+	t.Run("bad status", func(t *testing.T) {
+		mock.SetInjection(client.MDescribeIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			var err2 error
+			resp := &server.DescribeIndexResponse{}
+			resp.Status, err2 = client.BadStatus()
+			return resp, err2
+		})
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.Error(t, err)
+
+		mock.SetInjection(client.MCreateIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			return client.BadStatus()
+		})
+
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.Error(t, err)
+	})
+
+	t.Run("error", func(t *testing.T) {
+		mock.SetInjection(client.MDescribeIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			var err2 error
+			resp := &server.DescribeIndexResponse{}
+			resp.Status, err2 = client.BadRequestStatus()
+			return resp, err2
+		})
+		mock.SetInjection(client.MCreateIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			return client.SuccessStatus()
+		})
+
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.Error(t, err)
+
+		mock.SetInjection(client.MCreateIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			return client.BadRequestStatus()
+		})
+
+		err = c.CreateIndex(ctx, false, idx, SetCollectionNameForCreateIndex(collectionName),
+			SetFieldNameForCreateIndex(fieldName), SetIndexNameForCreateIndex(defaultIndexName))
+		assert.Error(t, err)
+	})
+}
+
+func TestGrpcClient_DescribeIndex(t *testing.T) {
+	ctx := context.Background()
+	c := testClient(ctx, t)
+
+	const (
+		collectionName   = "coll_index"
+		defaultIndexName = "_default_idx_101"
+		indexName        = "indexName"
+		emptyIndexName   = ""
+		fieldName        = "fieldName"
+	)
+
+	idx, err := entity.NewIndexHNSW(entity.L2, 16, 64)
+	assert.Nil(t, err)
+	if !assert.NotNil(t, idx) {
+		t.FailNow()
+	}
+
+	t.Run("normal", func(t *testing.T) {
+		mock.SetInjection(client.MDescribeIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			var err2 error
+			req, ok := message.(*server.DescribeIndexRequest)
+			resp := &server.DescribeIndexResponse{}
+			if !ok {
+				resp.Status, err2 = client.BadRequestStatus()
+				return resp, err2
+			}
+			assert.Equal(t, collectionName, req.GetCollectionName())
+
+			if req.GetIndexName() == emptyIndexName {
+				resp.IndexDescriptions = []*server.IndexDescription{
+					{
+						IndexName:            defaultIndexName,
+						IndexID:              1,
+						Params:               entity.MapKvPairs(idx.Params()),
+						FieldName:            req.GetFieldName(),
+						IndexedRows:          9000,
+						TotalRows:            10000,
+						State:                common.IndexState_InProgress,
+						IndexStateFailReason: "",
+					},
+					{
+						IndexName:            indexName,
+						IndexID:              2,
+						Params:               entity.MapKvPairs(idx.Params()),
+						FieldName:            req.GetFieldName(),
+						IndexedRows:          2500,
+						TotalRows:            3000,
+						State:                common.IndexState_InProgress,
+						IndexStateFailReason: "",
+					},
+				}
+			} else {
+				resp.IndexDescriptions = []*server.IndexDescription{
+					{
+						IndexName:            req.GetIndexName(),
+						IndexID:              1,
+						Params:               entity.MapKvPairs(idx.Params()),
+						FieldName:            req.GetFieldName(),
+						IndexedRows:          9000,
+						TotalRows:            10000,
+						State:                common.IndexState_InProgress,
+						IndexStateFailReason: "",
+					},
+				}
+			}
+			resp.Status, err2 = client.SuccessStatus()
+			return resp, err2
+		})
+
+		indexes, err := c.DescribeIndex(ctx, SetCollectionNameForDescribeIndex(collectionName),
+			SetIndexNameForDescribeIndex(indexName))
+		assert.NoError(t, err)
+		assert.Equal(t, 1, len(indexes))
+		assert.Equal(t, indexName, indexes[0].GetIndexName())
+	})
+
+	t.Run("empty collection name", func(t *testing.T) {
+		indexes, err := c.DescribeIndex(ctx,
+			SetIndexNameForDescribeIndex(indexName))
+		assert.Error(t, err)
+		assert.Equal(t, 0, len(indexes))
+	})
+
+	t.Run("empty index name", func(t *testing.T) {
+		indexes, err := c.DescribeIndex(ctx, SetCollectionNameForDescribeIndex(collectionName))
+		assert.NoError(t, err)
+		assert.Equal(t, 2, len(indexes))
+	})
+
+	t.Run("bad status", func(t *testing.T) {
+		mock.SetInjection(client.MDescribeIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			return &server.DescribeIndexResponse{
+				Status: &common.Status{
+					ErrorCode: common.ErrorCode_IndexNotExist,
+					Reason:    "index not exist",
+				},
+			}, nil
+		})
+		indexes, err := c.DescribeIndex(ctx, SetCollectionNameForDescribeIndex(collectionName))
+		assert.Error(t, err)
+		assert.Equal(t, 0, len(indexes))
+	})
+
+	t.Run("error", func(t *testing.T) {
+		mock.SetInjection(client.MDescribeIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			return &server.DescribeIndexResponse{
+				Status: &common.Status{
+					ErrorCode: common.ErrorCode_UnexpectedError,
+					Reason:    "",
+				},
+			}, errors.New("error")
+		})
+		indexes, err := c.DescribeIndex(ctx, SetCollectionNameForDescribeIndex(collectionName))
+		assert.Error(t, err)
+		assert.Equal(t, 0, len(indexes))
+	})
+}
+
+func TestGrpcClient_DropIndex(t *testing.T) {
+	ctx := context.Background()
+	c := testClient(ctx, t)
+
+	const (
+		collectionName   = "coll_index"
+		defaultIndexName = "_default_idx_101"
+		indexName        = "indexName"
+		emptyIndexName   = ""
+		fieldName        = "fieldName"
+	)
+
+	idx, err := entity.NewIndexHNSW(entity.L2, 16, 64)
+	assert.Nil(t, err)
+	if !assert.NotNil(t, idx) {
+		t.FailNow()
+	}
+
+	mock.SetInjection(client.MDropIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+		req, ok := message.(*server.DropIndexRequest)
+		if !ok {
+			return client.BadRequestStatus()
+		}
+		assert.Equal(t, collectionName, req.GetCollectionName())
+
+		return client.SuccessStatus()
+	})
+
+	t.Run("normal", func(t *testing.T) {
+		err = c.DropIndex(ctx, SetCollectionNameForDropIndex(collectionName), SetFieldNameForDroIndex(fieldName),
+			SetIndexNameForDropIndex(indexName))
+		assert.NoError(t, err)
+	})
+
+	t.Run("empty collection name", func(t *testing.T) {
+		err = c.DropIndex(ctx, SetFieldNameForDroIndex(fieldName),
+			SetIndexNameForDropIndex(indexName))
+		assert.Error(t, err)
+	})
+
+	t.Run("empty field name", func(t *testing.T) {
+		err = c.DropIndex(ctx, SetCollectionNameForDropIndex(collectionName), SetIndexNameForDropIndex(indexName))
+		assert.NoError(t, err)
+	})
+
+	t.Run("empty index name", func(t *testing.T) {
+		err = c.DropIndex(ctx, SetCollectionNameForDropIndex(collectionName), SetFieldNameForDroIndex(fieldName))
+		assert.NoError(t, err)
+
+		err = c.DropIndex(ctx, SetCollectionNameForDropIndex(collectionName))
+		assert.NoError(t, err)
+	})
+
+	t.Run("bad status", func(t *testing.T) {
+		mock.SetInjection(client.MDropIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			return client.BadStatus()
+		})
+		err = c.DropIndex(ctx, SetCollectionNameForDropIndex(collectionName))
+		assert.Error(t, err)
+	})
+
+	t.Run("error", func(t *testing.T) {
+		mock.SetInjection(client.MDropIndex, func(ctx context.Context, message proto.Message) (proto.Message, error) {
+			return &common.Status{
+				ErrorCode: common.ErrorCode_UnexpectedError,
+				Reason:    "fail",
+			}, errors.New("error")
+		})
+		err = c.DropIndex(ctx, SetCollectionNameForDropIndex(collectionName))
+		assert.Error(t, err)
+	})
+}
diff --git a/entity/indexes_gen_test.go b/entity/indexes_gen_test.go
index f90400a..19e9d89 100755
--- a/entity/indexes_gen_test.go
+++ b/entity/indexes_gen_test.go
@@ -1,5 +1,5 @@
 // Code generated by go generate; DO NOT EDIT
-// This file is generated by go generate at 2022-10-31 16:28:09.879855599 +0800 CST m=+0.003514342
+// This file is generated by go generate at 2022-11-02 17:52:36.293259532 +0800 CST m=+0.004066234
 
 package entity
 
@@ -12,16 +12,14 @@ import (
 
 func TestIndexFlat(t *testing.T){
 	
-	var nlist int
 
 	mt := L2
 	
 
 	t.Run("valid usage case", func(t *testing.T){
 		
-		nlist = 2048
+		
 		idx0, err := NewIndexFlat(mt, 
-			nlist,
 		)
 		assert.Nil(t, err)
 		assert.NotNil(t, idx0)
@@ -34,20 +32,6 @@ func TestIndexFlat(t *testing.T){
 
 	t.Run("invalid usage case", func(t *testing.T){
 		
-		nlist = 0
-		idx0, err := NewIndexFlat(mt, 
-			nlist,
-		)
-		assert.NotNil(t, err)
-		assert.Nil(t, idx0)
-		
-		nlist = 65537
-		idx1, err := NewIndexFlat(mt, 
-			nlist,
-		)
-		assert.NotNil(t, err)
-		assert.Nil(t, idx1)
-		
 	})
 }
 
diff --git a/entity/indexes_search_param_gen_test.go b/entity/indexes_search_param_gen_test.go
index 2ceb885..f66e1be 100755
--- a/entity/indexes_search_param_gen_test.go
+++ b/entity/indexes_search_param_gen_test.go
@@ -1,5 +1,5 @@
 // Code generated by go generate; DO NOT EDIT
-// This file is generated by go generate at 2022-10-31 16:28:09.879855599 +0800 CST m=+0.003514342
+// This file is generated by go generate at 2022-11-02 17:52:36.293259532 +0800 CST m=+0.004066234
 
 package entity
 
@@ -12,13 +12,11 @@ import (
 
 func TestIndexFlatSearchParam(t *testing.T) {
 	
-	var nprobe int
 
 	t.Run("valid usage case", func(t *testing.T){
 		
-		nprobe = 10
+		
 		idx0, err := NewIndexFlatSearchParam(
-			nprobe,
 		)
 		assert.Nil(t, err)
 		assert.NotNil(t, idx0)
@@ -26,24 +24,6 @@ func TestIndexFlatSearchParam(t *testing.T) {
 		
 	})
 	
-	t.Run("invalid usage case", func(t *testing.T){
-		
-		nprobe = 0
-		idx0, err := NewIndexFlatSearchParam(
-			nprobe,
-		)
-		assert.NotNil(t, err)
-		assert.Nil(t, idx0)
-		
-		nprobe = 65537
-		idx1, err := NewIndexFlatSearchParam(
-			nprobe,
-		)
-		assert.NotNil(t, err)
-		assert.Nil(t, idx1)
-		
-	})
-	
 }
 
 func TestIndexBinFlatSearchParam(t *testing.T) {
diff --git a/tests/client_dm_test.go b/tests/client_dm_test.go
index 17f871a..b95c0c2 100644
--- a/tests/client_dm_test.go
+++ b/tests/client_dm_test.go
@@ -21,7 +21,7 @@ func TestSearch(t *testing.T) {
 
 	waitRowCountChanged(t, c)
 	c.LoadCollection(context.Background(), cname, false)
-	sp, _ := entity.NewIndexFlatSearchParam(10)
+	sp, _ := entity.NewIndexFlatSearchParam()
 	results, err := c.Search(context.Background(), cname, []string{}, "int64 > 0", []string{"int64"}, []entity.Vector{entity.FloatVector(vectors[0])},
 		testVectorField, entity.L2, 10, sp)