mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
test: update cases for binary vectors support HNSW (#44928)
Signed-off-by: nico <cheng.yuan@zilliz.com>
This commit is contained in:
parent
27dbb8e75d
commit
eae6aff644
@ -3,12 +3,14 @@ from common import common_type as ct
|
||||
|
||||
success = "success"
|
||||
|
||||
|
||||
class HNSW:
|
||||
supported_vector_types = [
|
||||
DataType.FLOAT_VECTOR,
|
||||
DataType.FLOAT16_VECTOR,
|
||||
DataType.BFLOAT16_VECTOR,
|
||||
DataType.INT8_VECTOR
|
||||
DataType.INT8_VECTOR,
|
||||
DataType.BINARY_VECTOR
|
||||
]
|
||||
|
||||
supported_metrics = ['L2', 'IP', 'COSINE']
|
||||
|
||||
@ -1046,9 +1046,10 @@ class TestNewIndexBinary(TestcaseBase):
|
||||
c_name = cf.gen_unique_str(prefix)
|
||||
collection_w = self.init_collection_wrap(name=c_name, schema=default_binary_schema)
|
||||
binary_index_params = {'index_type': 'HNSW', "M": '18', "efConstruction": '240', 'metric_type': metric_type}
|
||||
error = {ct.err_code: 999, ct.err_msg: f"binary vector index does not support metric type: {metric_type}"}
|
||||
if metric_type in ["JACCARD", "HAMMING"]:
|
||||
error = {ct.err_code: 999, ct.err_msg: f"data type BinaryVector can't build with this index HNSW"}
|
||||
collection_w.create_index(default_binary_vec_field_name, binary_index_params)
|
||||
else:
|
||||
error = {ct.err_code: 999, ct.err_msg: f"binary vector index does not support metric type: {metric_type}"}
|
||||
collection_w.create_index(default_binary_vec_field_name, binary_index_params,
|
||||
check_task=CheckTasks.err_res,
|
||||
check_items=error)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user