Skip to content

Commit cdec5e4

Browse files
committed
enhance:support minhash function
Signed-off-by: cqy123456 <[email protected]>
1 parent 0d8fe79 commit cdec5e4

File tree

8 files changed

+128
-116
lines changed

8 files changed

+128
-116
lines changed

pymilvus/client/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class FunctionType(IntEnum):
142142
BM25 = 1
143143
TEXTEMBEDDING = 2
144144
RERANK = 3
145+
MINHASH = 4
145146

146147

147148
class RangeType(IntEnum):

pymilvus/grpc_gen/common_pb2.py

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymilvus/grpc_gen/common_pb2.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ class ObjectPrivilege(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
357357
PrivilegeAddCollectionFunction: _ClassVar[ObjectPrivilege]
358358
PrivilegeAlterCollectionFunction: _ClassVar[ObjectPrivilege]
359359
PrivilegeDropCollectionFunction: _ClassVar[ObjectPrivilege]
360+
PrivilegeUpdateReplicateConfiguration: _ClassVar[ObjectPrivilege]
360361

361362
class StateCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
362363
__slots__ = ()
@@ -706,6 +707,7 @@ PrivilegeListFileResources: ObjectPrivilege
706707
PrivilegeAddCollectionFunction: ObjectPrivilege
707708
PrivilegeAlterCollectionFunction: ObjectPrivilege
708709
PrivilegeDropCollectionFunction: ObjectPrivilege
710+
PrivilegeUpdateReplicateConfiguration: ObjectPrivilege
709711
Initializing: StateCode
710712
Healthy: StateCode
711713
Abnormal: StateCode

pymilvus/grpc_gen/milvus_pb2.py

Lines changed: 35 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymilvus/grpc_gen/schema_pb2.py

Lines changed: 66 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymilvus/grpc_gen/schema_pb2.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class FunctionType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
4141
BM25: _ClassVar[FunctionType]
4242
TextEmbedding: _ClassVar[FunctionType]
4343
Rerank: _ClassVar[FunctionType]
44+
MinHash: _ClassVar[FunctionType]
4445

4546
class FieldState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
4647
__slots__ = ()
@@ -76,6 +77,7 @@ Unknown: FunctionType
7677
BM25: FunctionType
7778
TextEmbedding: FunctionType
7879
Rerank: FunctionType
80+
MinHash: FunctionType
7981
FieldCreated: FieldState
8082
FieldCreating: FieldState
8183
FieldDropping: FieldState
@@ -148,7 +150,7 @@ class FunctionScore(_message.Message):
148150
def __init__(self, functions: _Optional[_Iterable[_Union[FunctionSchema, _Mapping]]] = ..., params: _Optional[_Iterable[_Union[_common_pb2.KeyValuePair, _Mapping]]] = ...) -> None: ...
149151

150152
class CollectionSchema(_message.Message):
151-
__slots__ = ("name", "description", "autoID", "fields", "enable_dynamic_field", "properties", "functions", "dbName", "struct_array_fields")
153+
__slots__ = ("name", "description", "autoID", "fields", "enable_dynamic_field", "properties", "functions", "dbName", "struct_array_fields", "version")
152154
NAME_FIELD_NUMBER: _ClassVar[int]
153155
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
154156
AUTOID_FIELD_NUMBER: _ClassVar[int]
@@ -158,6 +160,7 @@ class CollectionSchema(_message.Message):
158160
FUNCTIONS_FIELD_NUMBER: _ClassVar[int]
159161
DBNAME_FIELD_NUMBER: _ClassVar[int]
160162
STRUCT_ARRAY_FIELDS_FIELD_NUMBER: _ClassVar[int]
163+
VERSION_FIELD_NUMBER: _ClassVar[int]
161164
name: str
162165
description: str
163166
autoID: bool
@@ -167,7 +170,8 @@ class CollectionSchema(_message.Message):
167170
functions: _containers.RepeatedCompositeFieldContainer[FunctionSchema]
168171
dbName: str
169172
struct_array_fields: _containers.RepeatedCompositeFieldContainer[StructArrayFieldSchema]
170-
def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., autoID: bool = ..., fields: _Optional[_Iterable[_Union[FieldSchema, _Mapping]]] = ..., enable_dynamic_field: bool = ..., properties: _Optional[_Iterable[_Union[_common_pb2.KeyValuePair, _Mapping]]] = ..., functions: _Optional[_Iterable[_Union[FunctionSchema, _Mapping]]] = ..., dbName: _Optional[str] = ..., struct_array_fields: _Optional[_Iterable[_Union[StructArrayFieldSchema, _Mapping]]] = ...) -> None: ...
173+
version: int
174+
def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., autoID: bool = ..., fields: _Optional[_Iterable[_Union[FieldSchema, _Mapping]]] = ..., enable_dynamic_field: bool = ..., properties: _Optional[_Iterable[_Union[_common_pb2.KeyValuePair, _Mapping]]] = ..., functions: _Optional[_Iterable[_Union[FunctionSchema, _Mapping]]] = ..., dbName: _Optional[str] = ..., struct_array_fields: _Optional[_Iterable[_Union[StructArrayFieldSchema, _Mapping]]] = ..., version: _Optional[int] = ...) -> None: ...
171175

172176
class StructArrayFieldSchema(_message.Message):
173177
__slots__ = ("fieldID", "name", "description", "fields", "type_params")

pymilvus/orm/schema.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,11 @@ def verify(self, schema: CollectionSchema):
906906
self._check_bm25_function(schema)
907907
elif self._type == FunctionType.TEXTEMBEDDING:
908908
self._check_text_embedding_function(schema)
909-
elif self._type == FunctionType.RANKER:
910-
# We will not check the ranker function here.
909+
elif self._type == FunctionType.RERANK:
910+
# We will not check the rerank function here.
911+
pass
912+
elif self._type == FunctionType.MINHASH:
913+
# milvus will do the check job
911914
pass
912915
elif self._type == FunctionType.UNKNOWN:
913916
raise ParamError(message=ExceptionsMessage.UnknownFunctionType)

0 commit comments

Comments
 (0)