diff --git a/go.mod b/go.mod index b641f5e4c535d..d26e77871ce7e 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/klauspost/compress v1.16.7 github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d - github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20231220103033-abd0d12ba669 + github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20231228051838-b5442d755fa4 github.com/minio/minio-go/v7 v7.0.61 github.com/prometheus/client_golang v1.14.0 github.com/prometheus/client_model v0.3.0 @@ -53,7 +53,6 @@ require ( golang.org/x/text v0.13.0 google.golang.org/grpc v1.57.0 google.golang.org/grpc/examples v0.0.0-20220617181431-3e7b97febc7f - stathat.com/c/consistent v1.0.0 ) require github.com/apache/arrow/go/v12 v12.0.1 @@ -244,10 +243,10 @@ replace ( github.com/bketelsen/crypt => github.com/bketelsen/crypt v0.0.4 // Fix security alert for core-os/etcd github.com/expr-lang/expr => github.com/SimFG/expr v0.0.0-20231218130003-94d085776dc5 github.com/go-kit/kit => github.com/go-kit/kit v0.1.0 + // github.com/milvus-io/milvus-storage/go => ../milvus-storage/go github.com/milvus-io/milvus/pkg => ./pkg github.com/streamnative/pulsarctl => github.com/xiaofan-luan/pulsarctl v0.5.1 github.com/tecbot/gorocksdb => github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b // indirect -// github.com/milvus-io/milvus-storage/go => ../milvus-storage/go ) exclude github.com/apache/pulsar-client-go/oauth2 v0.0.0-20211108044248-fe3b7c4e445b diff --git a/go.sum b/go.sum index 9e22ac81cd2c7..95c831d51ad9f 100644 --- a/go.sum +++ b/go.sum @@ -583,8 +583,8 @@ github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/le github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZzUfIfYe5qYDBzt4ZYRqzUjTR6CvUzjat8= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4= -github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20231220103033-abd0d12ba669 h1:yUtc+pVKVhmmnwTY9iyV8+EmhrNjZ74Hxm3y5QKCNyg= -github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20231220103033-abd0d12ba669/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek= +github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20231228051838-b5442d755fa4 h1:nxIohfJOCMbixFAC3q4Lclmv0xg/8q6D8T7D8l258To= +github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20231228051838-b5442d755fa4/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek= github.com/milvus-io/milvus-storage/go v0.0.0-20231109072809-1cd7b0866092 h1:UYJ7JB+QlMOoFHNdd8mUa3/lV63t9dnBX7ILXmEEWPY= github.com/milvus-io/milvus-storage/go v0.0.0-20231109072809-1cd7b0866092/go.mod h1:GPETMcTZq1gLY1WA6Na5kiNAKnq8SEMMiVKUZrM3sho= github.com/milvus-io/pulsar-client-go v0.6.10 h1:eqpJjU+/QX0iIhEo3nhOqMNXL+TyInAs1IAHZCrCM/A= @@ -1491,4 +1491,3 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= stathat.com/c/consistent v1.0.0 h1:ezyc51EGcRPJUxfHGSgJjWzJdj3NiMU9pNfLNGiXV0c= -stathat.com/c/consistent v1.0.0/go.mod h1:QkzMWzcbB+yQBL2AttO6sgsQS/JSTapcDISJalmCDS0= diff --git a/internal/distributed/proxy/service.go b/internal/distributed/proxy/service.go index 5ef5bae144509..0c4328e3b1717 100644 --- a/internal/distributed/proxy/service.go +++ b/internal/distributed/proxy/service.go @@ -872,8 +872,8 @@ func (s *Server) Search(ctx context.Context, request *milvuspb.SearchRequest) (* return s.proxy.Search(ctx, request) } -func (s *Server) SearchV2(ctx context.Context, request *milvuspb.SearchRequestV2) (*milvuspb.SearchResults, error) { - return s.proxy.SearchV2(ctx, request) +func (s *Server) HybridSearch(ctx context.Context, request *milvuspb.HybridSearchRequest) (*milvuspb.SearchResults, error) { + return s.proxy.HybridSearch(ctx, request) } func (s *Server) Flush(ctx context.Context, request *milvuspb.FlushRequest) (*milvuspb.FlushResponse, error) { diff --git a/internal/mocks/mock_proxy.go b/internal/mocks/mock_proxy.go index 1186f90632e8c..98a866b7e1f01 100644 --- a/internal/mocks/mock_proxy.go +++ b/internal/mocks/mock_proxy.go @@ -3153,6 +3153,61 @@ func (_c *MockProxy_HasPartition_Call) RunAndReturn(run func(context.Context, *m return _c } +// HybridSearch provides a mock function with given fields: _a0, _a1 +func (_m *MockProxy) HybridSearch(_a0 context.Context, _a1 *milvuspb.HybridSearchRequest) (*milvuspb.SearchResults, error) { + ret := _m.Called(_a0, _a1) + + var r0 *milvuspb.SearchResults + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.HybridSearchRequest) (*milvuspb.SearchResults, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.HybridSearchRequest) *milvuspb.SearchResults); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*milvuspb.SearchResults) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.HybridSearchRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockProxy_HybridSearch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HybridSearch' +type MockProxy_HybridSearch_Call struct { + *mock.Call +} + +// HybridSearch is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *milvuspb.HybridSearchRequest +func (_e *MockProxy_Expecter) HybridSearch(_a0 interface{}, _a1 interface{}) *MockProxy_HybridSearch_Call { + return &MockProxy_HybridSearch_Call{Call: _e.mock.On("HybridSearch", _a0, _a1)} +} + +func (_c *MockProxy_HybridSearch_Call) Run(run func(_a0 context.Context, _a1 *milvuspb.HybridSearchRequest)) *MockProxy_HybridSearch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*milvuspb.HybridSearchRequest)) + }) + return _c +} + +func (_c *MockProxy_HybridSearch_Call) Return(_a0 *milvuspb.SearchResults, _a1 error) *MockProxy_HybridSearch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockProxy_HybridSearch_Call) RunAndReturn(run func(context.Context, *milvuspb.HybridSearchRequest) (*milvuspb.SearchResults, error)) *MockProxy_HybridSearch_Call { + _c.Call.Return(run) + return _c +} + // Import provides a mock function with given fields: _a0, _a1 func (_m *MockProxy) Import(_a0 context.Context, _a1 *milvuspb.ImportRequest) (*milvuspb.ImportResponse, error) { ret := _m.Called(_a0, _a1) @@ -4610,61 +4665,6 @@ func (_c *MockProxy_Search_Call) RunAndReturn(run func(context.Context, *milvusp return _c } -// SearchV2 provides a mock function with given fields: _a0, _a1 -func (_m *MockProxy) SearchV2(_a0 context.Context, _a1 *milvuspb.SearchRequestV2) (*milvuspb.SearchResults, error) { - ret := _m.Called(_a0, _a1) - - var r0 *milvuspb.SearchResults - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SearchRequestV2) (*milvuspb.SearchResults, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SearchRequestV2) *milvuspb.SearchResults); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*milvuspb.SearchResults) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.SearchRequestV2) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockProxy_SearchV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchV2' -type MockProxy_SearchV2_Call struct { - *mock.Call -} - -// SearchV2 is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.SearchRequestV2 -func (_e *MockProxy_Expecter) SearchV2(_a0 interface{}, _a1 interface{}) *MockProxy_SearchV2_Call { - return &MockProxy_SearchV2_Call{Call: _e.mock.On("SearchV2", _a0, _a1)} -} - -func (_c *MockProxy_SearchV2_Call) Run(run func(_a0 context.Context, _a1 *milvuspb.SearchRequestV2)) *MockProxy_SearchV2_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*milvuspb.SearchRequestV2)) - }) - return _c -} - -func (_c *MockProxy_SearchV2_Call) Return(_a0 *milvuspb.SearchResults, _a1 error) *MockProxy_SearchV2_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockProxy_SearchV2_Call) RunAndReturn(run func(context.Context, *milvuspb.SearchRequestV2) (*milvuspb.SearchResults, error)) *MockProxy_SearchV2_Call { - _c.Call.Return(run) - return _c -} - // SelectGrant provides a mock function with given fields: _a0, _a1 func (_m *MockProxy) SelectGrant(_a0 context.Context, _a1 *milvuspb.SelectGrantRequest) (*milvuspb.SelectGrantResponse, error) { ret := _m.Called(_a0, _a1) diff --git a/internal/proxy/impl.go b/internal/proxy/impl.go index 65f5c87bfe0cd..e3edb13bdc9a2 100644 --- a/internal/proxy/impl.go +++ b/internal/proxy/impl.go @@ -2725,7 +2725,7 @@ func (node *Proxy) Search(ctx context.Context, request *milvuspb.SearchRequest) return qt.result, nil } -func (node *Proxy) SearchV2(ctx context.Context, request *milvuspb.SearchRequestV2) (*milvuspb.SearchResults, error) { +func (node *Proxy) HybridSearch(ctx context.Context, request *milvuspb.HybridSearchRequest) (*milvuspb.SearchResults, error) { return &milvuspb.SearchResults{ Status: merr.Status(merr.WrapErrServiceInternal("unimplemented")), }, nil