提交 58dde9cd 编写于 作者: J JinHai-CN

Merge branch 'master' of https://github.com/milvus-io/milvus

......@@ -90,118 +90,118 @@ def milvus(request):
@pytest.fixture(scope="function")
def table(request, connect):
ori_table_name = getattr(request.module, "table_id", "test")
table_name = gen_unique_str(ori_table_name)
def collection(request, connect):
ori_collection_name = getattr(request.module, "collection_id", "test")
collection_name = gen_unique_str(ori_collection_name)
dim = getattr(request.module, "dim", "128")
param = {'table_name': table_name,
param = {'collection_name': collection_name,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.L2}
status = connect.create_table(param)
status = connect.create_collection(param)
# logging.getLogger().info(status)
if not status.OK():
pytest.exit("Table can not be created, exit pytest ...")
pytest.exit("collection can not be created, exit pytest ...")
def teardown():
status, table_names = connect.show_tables()
for table_name in table_names:
connect.delete_table(table_name)
status, collection_names = connect.show_collections()
for collection_name in collection_names:
connect.drop_collection(collection_name)
request.addfinalizer(teardown)
return table_name
return collection_name
@pytest.fixture(scope="function")
def ip_table(request, connect):
ori_table_name = getattr(request.module, "table_id", "test")
table_name = gen_unique_str(ori_table_name)
def ip_collection(request, connect):
ori_collection_name = getattr(request.module, "collection_id", "test")
collection_name = gen_unique_str(ori_collection_name)
dim = getattr(request.module, "dim", "128")
param = {'table_name': table_name,
param = {'collection_name': collection_name,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.IP}
status = connect.create_table(param)
status = connect.create_collection(param)
# logging.getLogger().info(status)
if not status.OK():
pytest.exit("Table can not be created, exit pytest ...")
pytest.exit("collection can not be created, exit pytest ...")
def teardown():
status, table_names = connect.show_tables()
for table_name in table_names:
connect.delete_table(table_name)
status, collection_names = connect.show_collections()
for collection_name in collection_names:
connect.drop_collection(collection_name)
request.addfinalizer(teardown)
return table_name
return collection_name
@pytest.fixture(scope="function")
def jac_table(request, connect):
ori_table_name = getattr(request.module, "table_id", "test")
table_name = gen_unique_str(ori_table_name)
def jac_collection(request, connect):
ori_collection_name = getattr(request.module, "collection_id", "test")
collection_name = gen_unique_str(ori_collection_name)
dim = getattr(request.module, "dim", "128")
param = {'table_name': table_name,
param = {'collection_name': collection_name,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.JACCARD}
status = connect.create_table(param)
status = connect.create_collection(param)
# logging.getLogger().info(status)
if not status.OK():
pytest.exit("Table can not be created, exit pytest ...")
pytest.exit("collection can not be created, exit pytest ...")
def teardown():
status, table_names = connect.show_tables()
for table_name in table_names:
connect.delete_table(table_name)
status, collection_names = connect.show_collections()
for collection_name in collection_names:
connect.drop_collection(collection_name)
request.addfinalizer(teardown)
return table_name
return collection_name
@pytest.fixture(scope="function")
def ham_table(request, connect):
ori_table_name = getattr(request.module, "table_id", "test")
table_name = gen_unique_str(ori_table_name)
def ham_collection(request, connect):
ori_collection_name = getattr(request.module, "collection_id", "test")
collection_name = gen_unique_str(ori_collection_name)
dim = getattr(request.module, "dim", "128")
param = {'table_name': table_name,
param = {'collection_name': collection_name,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.HAMMING}
status = connect.create_table(param)
status = connect.create_collection(param)
# logging.getLogger().info(status)
if not status.OK():
pytest.exit("Table can not be created, exit pytest ...")
pytest.exit("collection can not be created, exit pytest ...")
def teardown():
status, table_names = connect.show_tables()
for table_name in table_names:
connect.delete_table(table_name)
status, collection_names = connect.show_collections()
for collection_name in collection_names:
connect.drop_collection(collection_name)
request.addfinalizer(teardown)
return table_name
return collection_name
@pytest.fixture(scope="function")
def tanimoto_table(request, connect):
ori_table_name = getattr(request.module, "table_id", "test")
table_name = gen_unique_str(ori_table_name)
def tanimoto_collection(request, connect):
ori_collection_name = getattr(request.module, "collection_id", "test")
collection_name = gen_unique_str(ori_collection_name)
dim = getattr(request.module, "dim", "128")
param = {'table_name': table_name,
param = {'collection_name': collection_name,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.TANIMOTO}
status = connect.create_table(param)
status = connect.create_collection(param)
# logging.getLogger().info(status)
if not status.OK():
pytest.exit("Table can not be created, exit pytest ...")
pytest.exit("collection can not be created, exit pytest ...")
def teardown():
status, table_names = connect.show_tables()
for table_name in table_names:
connect.delete_table(table_name)
status, collection_names = connect.show_collections()
for collection_name in collection_names:
connect.drop_collection(collection_name)
request.addfinalizer(teardown)
return table_name
\ No newline at end of file
return collection_name
......@@ -18,7 +18,7 @@ nb = 6000
nlist = 1024
class TestTableInfoBase:
class TestCollectionInfoBase:
def index_string_convert(self, index_string, index_type):
if index_string == "IDMAP" and index_type == IndexType.FLAT:
return True
......@@ -30,87 +30,87 @@ class TestTableInfoBase:
"""
******************************************************************
The following cases are used to test `table_info` function
The following cases are used to test `collection_info` function
******************************************************************
"""
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_name_None(self, connect, table):
def test_get_collection_info_name_None(self, connect, collection):
'''
target: get table info where table name is None
method: call table_info with the table_name: None
target: get collection info where collection name is None
method: call collection_info with the collection_name: None
expected: status not ok
'''
table_name = None
status, info = connect.table_info(table_name)
collection_name = None
status, info = connect.collection_info(collection_name)
assert not status.OK()
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_name_not_existed(self, connect, table):
def test_get_collection_info_name_not_existed(self, connect, collection):
'''
target: get table info where table name does not exist
method: call table_info with a random table_name, which is not in db
target: get collection info where collection name does not exist
method: call collection_info with a random collection_name, which is not in db
expected: status not ok
'''
table_name = gen_unique_str("not_existed_table")
status, info = connect.table_info(table_name)
collection_name = gen_unique_str("not_existed_collection")
status, info = connect.collection_info(collection_name)
assert not status.OK()
@pytest.fixture(
scope="function",
params=gen_invalid_table_names()
params=gen_invalid_collection_names()
)
def get_table_name(self, request):
def get_collection_name(self, request):
yield request.param
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_name_invalid(self, connect, get_table_name):
def test_get_collection_info_name_invalid(self, connect, get_collection_name):
'''
target: get table info where table name is invalid
method: call table_info with invalid table_name
target: get collection info where collection name is invalid
method: call collection_info with invalid collection_name
expected: status not ok
'''
table_name = get_table_name
status, info = connect.table_info(table_name)
collection_name = get_collection_name
status, info = connect.collection_info(collection_name)
assert not status.OK()
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_table_row_count(self, connect, table):
def test_get_collection_info_collection_row_count(self, connect, collection):
'''
target: get row count with table_info
method: add and delete vectors, check count in table info
target: get row count with collection_info
method: add and delete vectors, check count in collection info
expected: status ok, count as expected
'''
vectors = gen_vector(nb, dim)
status, ids = connect.add_vectors(table, vectors)
status, ids = connect.add_vectors(collection, vectors)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
assert info.count == nb
# delete a few vectors
delete_ids = [ids[0], ids[-1]]
status = connect.delete_by_id(table, delete_ids)
status = connect.delete_by_id(collection, delete_ids)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
assert info.count == nb - 2
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_partition_stats_A(self, connect, table):
def test_get_collection_info_partition_stats_A(self, connect, collection):
'''
target: get partition info in a table
method: no partition, call table_info and check partition_stats
target: get partition info in a collection
method: no partition, call collection_info and check partition_stats
expected: status ok, "_default" partition is listed
'''
vectors = gen_vector(nb, dim)
status, ids = connect.add_vectors(table, vectors)
status, ids = connect.add_vectors(collection, vectors)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
logging.getLogger().info(info)
assert len(info.partitions_stat) == 1
......@@ -119,19 +119,19 @@ class TestTableInfoBase:
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_partition_stats_B(self, connect, table):
def test_get_collection_info_partition_stats_B(self, connect, collection):
'''
target: get partition info in a table
method: call table_info after partition created and check partition_stats
target: get partition info in a collection
method: call collection_info after partition created and check partition_stats
expected: status ok, vectors added to partition
'''
vectors = gen_vectors(nb, dim)
status = connect.create_partition(table, tag)
status, ids = connect.add_vectors(table, vectors, partition_tag=tag)
status = connect.create_partition(collection, tag)
status, ids = connect.add_vectors(collection, vectors, partition_tag=tag)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
logging.getLogger().info(info)
assert len(info.partitions_stat) == 2
......@@ -139,23 +139,23 @@ class TestTableInfoBase:
assert info.partitions_stat[1].count == nb
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_partition_stats_C(self, connect, table):
def test_get_collection_info_partition_stats_C(self, connect, collection):
'''
target: get partition info in a table
method: create two partitions, add vectors in one of the partitions, call table_info and check
target: get partition info in a collection
method: create two partitions, add vectors in one of the partitions, call collection_info and check
expected: status ok, vectors added to one partition but not the other
'''
new_tag = "new_tag"
vectors = gen_vectors(nb, dim)
status = connect.create_partition(table, tag)
status = connect.create_partition(collection, tag)
assert status.OK()
status = connect.create_partition(table, new_tag)
status = connect.create_partition(collection, new_tag)
assert status.OK()
status, ids = connect.add_vectors(table, vectors, partition_tag=tag)
status, ids = connect.add_vectors(collection, vectors, partition_tag=tag)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
logging.getLogger().info(info)
for partition in info.partitions_stat:
......@@ -165,25 +165,25 @@ class TestTableInfoBase:
assert partition.count == 0
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_partition_stats_D(self, connect, table):
def test_get_collection_info_partition_stats_D(self, connect, collection):
'''
target: get partition info in a table
method: create two partitions, add vectors in both partitions, call table_info and check
target: get partition info in a collection
method: create two partitions, add vectors in both partitions, call collection_info and check
expected: status ok, vectors added to both partitions
'''
new_tag = "new_tag"
vectors = gen_vectors(nb, dim)
status = connect.create_partition(table, tag)
status = connect.create_partition(collection, tag)
assert status.OK()
status = connect.create_partition(table, new_tag)
status = connect.create_partition(collection, new_tag)
assert status.OK()
status, ids = connect.add_vectors(table, vectors, partition_tag=tag)
status, ids = connect.add_vectors(collection, vectors, partition_tag=tag)
assert status.OK()
status, ids = connect.add_vectors(table, vectors, partition_tag=new_tag)
status, ids = connect.add_vectors(collection, vectors, partition_tag=new_tag)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
assert info.count == nb * 2
for partition in info.partitions_stat:
......@@ -205,24 +205,24 @@ class TestTableInfoBase:
return request.param
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_after_index_created(self, connect, table, get_simple_index):
def test_get_collection_info_after_index_created(self, connect, collection, get_simple_index):
'''
target: test table info after index created
method: create table, add vectors, create index and call table_info
target: test collection info after index created
method: create collection, add vectors, create index and call collection_info
expected: status ok, index created and shown in segments_stat
'''
index_param = get_simple_index["index_param"]
index_type = get_simple_index["index_type"]
vectors = gen_vector(nb, dim)
status, ids = connect.add_vectors(table, vectors)
status, ids = connect.add_vectors(collection, vectors)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status = connect.create_index(table, index_type, index_param)
status = connect.create_index(collection, index_type, index_param)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
logging.getLogger().info(info)
index_string = info.partitions_stat[0].segments_stat[0].index_name
......@@ -231,24 +231,24 @@ class TestTableInfoBase:
assert nb == info.partitions_stat[0].segments_stat[0].count
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_after_create_same_index_repeatedly(self, connect, table, get_simple_index):
def test_get_collection_info_after_create_same_index_repeatedly(self, connect, collection, get_simple_index):
'''
target: test table info after index created repeatedly
method: create table, add vectors, create index and call table_info multiple times
target: test collection info after index created repeatedly
method: create collection, add vectors, create index and call collection_info multiple times
expected: status ok, index info shown in segments_stat
'''
index_param = get_simple_index["index_param"]
index_type = get_simple_index["index_type"]
vectors = gen_vector(nb, dim)
status, ids = connect.add_vectors(table, vectors)
status, ids = connect.add_vectors(collection, vectors)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
status = connect.create_index(table, index_type, index_param)
status = connect.create_index(table, index_type, index_param)
status = connect.create_index(table, index_type, index_param)
status = connect.create_index(collection, index_type, index_param)
status = connect.create_index(collection, index_type, index_param)
status = connect.create_index(collection, index_type, index_param)
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
logging.getLogger().info(info)
index_string = info.partitions_stat[0].segments_stat[0].index_name
......@@ -257,22 +257,22 @@ class TestTableInfoBase:
assert nb == info.partitions_stat[0].segments_stat[0].count
@pytest.mark.timeout(INFO_TIMEOUT)
def test_get_table_info_after_create_different_index_repeatedly(self, connect, table, get_simple_index):
def test_get_collection_info_after_create_different_index_repeatedly(self, connect, collection, get_simple_index):
'''
target: test table info after index created repeatedly
method: create table, add vectors, create index and call table_info multiple times
target: test collection info after index created repeatedly
method: create collection, add vectors, create index and call collection_info multiple times
expected: status ok, index info shown in segments_stat
'''
vectors = gen_vector(nb, dim)
status, ids = connect.add_vectors(table, vectors)
status, ids = connect.add_vectors(collection, vectors)
assert status.OK()
status = connect.flush([table])
status = connect.flush([collection])
assert status.OK()
index_param = {"nlist": nlist}
for index_type in [IndexType.FLAT, IndexType.IVFLAT, IndexType.IVF_SQ8]:
status = connect.create_index(table, index_type, index_param)
status = connect.create_index(collection, index_type, index_param)
assert status.OK()
status, info = connect.table_info(table)
status, info = connect.collection_info(collection)
assert status.OK()
logging.getLogger().info(info)
index_string = info.partitions_stat[0].segments_stat[0].index_name
......
......@@ -285,7 +285,7 @@ class TestConnect:
b. data_set not too large incase disconnection happens when data is underd-preparing
c. data_set not too small incase disconnection happens when data has already been transferred
d. make sure disconnection happens when data is in-transport
Expected: Failure, get_table_row_count == 0
Expected: Failure, count_collection == 0
'''
pass
......
......@@ -12,7 +12,7 @@ from utils import *
dim = 128
index_file_size = 10
table_id = "test_mix"
collection_id = "test_mix"
add_interval_time = 2
vectors = gen_vectors(10000, dim)
vectors = sklearn.preprocessing.normalize(vectors, axis=1, norm='l2')
......@@ -29,35 +29,35 @@ class TestMixBase:
# disable
def _test_search_during_createIndex(self, args):
loops = 10000
table = gen_unique_str()
collection = gen_unique_str()
query_vecs = [vectors[0], vectors[1]]
uri = "tcp://%s:%s" % (args["ip"], args["port"])
id_0 = 0; id_1 = 0
milvus_instance = get_milvus(args["handler"])
milvus_instance.connect(uri=uri)
milvus_instance.create_table({'table_name': table,
milvus_instance.create_collection({'collection_name': collection,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.L2})
for i in range(10):
status, ids = milvus_instance.add_vectors(table, vectors)
status, ids = milvus_instance.add_vectors(collection, vectors)
# logging.getLogger().info(ids)
if i == 0:
id_0 = ids[0]; id_1 = ids[1]
def create_index(milvus_instance):
logging.getLogger().info("In create index")
status = milvus_instance.create_index(table, index_params)
status = milvus_instance.create_index(collection, index_params)
logging.getLogger().info(status)
status, result = milvus_instance.describe_index(table)
status, result = milvus_instance.describe_index(collection)
logging.getLogger().info(result)
def add_vectors(milvus_instance):
logging.getLogger().info("In add vectors")
status, ids = milvus_instance.add_vectors(table, vectors)
status, ids = milvus_instance.add_vectors(collection, vectors)
logging.getLogger().info(status)
def search(milvus_instance):
logging.getLogger().info("In search vectors")
for i in range(loops):
status, result = milvus_instance.search_vectors(table, top_k, nprobe, query_vecs)
status, result = milvus_instance.search_vectors(collection, top_k, nprobe, query_vecs)
logging.getLogger().info(status)
assert result[0][0].id == id_0
assert result[1][0].id == id_1
......@@ -72,82 +72,82 @@ class TestMixBase:
p_create.join()
@pytest.mark.level(2)
def test_mix_multi_tables(self, connect):
def test_mix_multi_collections(self, connect):
'''
target: test functions with multiple tables of different metric_types and index_types
method: create 60 tables which 30 are L2 and the other are IP, add vectors into them
target: test functions with multiple collections of different metric_types and index_types
method: create 60 collections which 30 are L2 and the other are IP, add vectors into them
and test describe index and search
expected: status ok
'''
nq = 10000
table_list = []
collection_list = []
idx = []
index_param = {'nlist': nlist}
#create table and add vectors
#create collection and add vectors
for i in range(30):
table_name = gen_unique_str('test_mix_multi_tables')
table_list.append(table_name)
param = {'table_name': table_name,
collection_name = gen_unique_str('test_mix_multi_collections')
collection_list.append(collection_name)
param = {'collection_name': collection_name,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.L2}
connect.create_table(param)
status, ids = connect.add_vectors(table_name=table_name, records=vectors)
connect.create_collection(param)
status, ids = connect.add_vectors(collection_name=collection_name, records=vectors)
idx.append(ids[0])
idx.append(ids[10])
idx.append(ids[20])
assert status.OK()
for i in range(30):
table_name = gen_unique_str('test_mix_multi_tables')
table_list.append(table_name)
param = {'table_name': table_name,
collection_name = gen_unique_str('test_mix_multi_collections')
collection_list.append(collection_name)
param = {'collection_name': collection_name,
'dimension': dim,
'index_file_size': index_file_size,
'metric_type': MetricType.IP}
connect.create_table(param)
status, ids = connect.add_vectors(table_name=table_name, records=vectors)
connect.create_collection(param)
status, ids = connect.add_vectors(collection_name=collection_name, records=vectors)
assert status.OK()
status = connect.flush([table_name])
status = connect.flush([collection_name])
assert status.OK()
idx.append(ids[0])
idx.append(ids[10])
idx.append(ids[20])
assert status.OK()
for i in range(10):
status = connect.create_index(table_list[i], IndexType.FLAT, index_param)
status = connect.create_index(collection_list[i], IndexType.FLAT, index_param)
assert status.OK()
status = connect.create_index(table_list[30 + i], IndexType.FLAT, index_param)
status = connect.create_index(collection_list[30 + i], IndexType.FLAT, index_param)
assert status.OK()
status = connect.create_index(table_list[10 + i], IndexType.IVFLAT, index_param)
status = connect.create_index(collection_list[10 + i], IndexType.IVFLAT, index_param)
assert status.OK()
status = connect.create_index(table_list[40 + i], IndexType.IVFLAT, index_param)
status = connect.create_index(collection_list[40 + i], IndexType.IVFLAT, index_param)
assert status.OK()
status = connect.create_index(table_list[20 + i], IndexType.IVF_SQ8, index_param)
status = connect.create_index(collection_list[20 + i], IndexType.IVF_SQ8, index_param)
assert status.OK()
status = connect.create_index(table_list[50 + i], IndexType.IVF_SQ8, index_param)
status = connect.create_index(collection_list[50 + i], IndexType.IVF_SQ8, index_param)
assert status.OK()
#describe index
for i in range(10):
status, result = connect.describe_index(table_list[i])
status, result = connect.describe_index(collection_list[i])
assert result._index_type == IndexType.FLAT
status, result = connect.describe_index(table_list[10 + i])
status, result = connect.describe_index(collection_list[10 + i])
assert result._index_type == IndexType.IVFLAT
status, result = connect.describe_index(table_list[20 + i])
status, result = connect.describe_index(collection_list[20 + i])
assert result._index_type == IndexType.IVF_SQ8
status, result = connect.describe_index(table_list[30 + i])
status, result = connect.describe_index(collection_list[30 + i])
assert result._index_type == IndexType.FLAT
status, result = connect.describe_index(table_list[40 + i])
status, result = connect.describe_index(collection_list[40 + i])
assert result._index_type == IndexType.IVFLAT
status, result = connect.describe_index(table_list[50 + i])
status, result = connect.describe_index(collection_list[50 + i])
assert result._index_type == IndexType.IVF_SQ8
#search
query_vecs = [vectors[0], vectors[10], vectors[20]]
for i in range(60):
table = table_list[i]
status, result = connect.search_vectors(table, top_k, query_records=query_vecs, params={"nprobe": 1})
collection = collection_list[i]
status, result = connect.search_vectors(collection, top_k, query_records=query_vecs, params={"nprobe": 1})
assert status.OK()
assert len(result) == len(query_vecs)
logging.getLogger().info(i)
......
......@@ -146,8 +146,8 @@ def gen_invalid_uris():
return uris
def gen_invalid_table_names():
table_names = [
def gen_invalid_collection_names():
collection_names = [
"12-s",
"12/s",
" ",
......@@ -166,7 +166,7 @@ def gen_invalid_table_names():
"中文",
"a".join("a" for i in range(256))
]
return table_names
return collection_names
def gen_invalid_top_ks():
......@@ -588,7 +588,7 @@ def gen_simple_index():
IndexType.IVF_SQ8H,
IndexType.IVF_PQ,
IndexType.HNSW,
# IndexType.RNSG
IndexType.RNSG
]
params = [
{"nlist": 1024},
......@@ -597,7 +597,7 @@ def gen_simple_index():
{"nlist": 1024},
{"nlist": 1024, "m": 16},
{"M": 16, "efConstruction": 500},
# {"search_length": 100, "out_degree": 40, "candidate_pool_size": 66, "knng": 100}
{"search_length": 50, "out_degree": 40, "candidate_pool_size": 100, "knng": 50}
]
index_params = []
......@@ -611,14 +611,14 @@ def get_search_param(index_type):
return {"nprobe": 32}
elif index_type == IndexType.HNSW:
return {"ef": 64}
# elif index_type == IndexType.RNSG:
# return {"search_length": 100}
elif index_type == IndexType.RNSG:
return {"search_length": 50}
else:
logging.getLogger().info("Invalid index_type.")
def assert_has_table(conn, table_name):
status, ok = conn.has_table(table_name)
def assert_has_collection(conn, collection_name):
status, ok = conn.has_collection(collection_name)
return status.OK() and ok
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册