Update range search test cases (#22900)

Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
pull/22938/head
binbin 2023-03-23 10:45:58 +08:00 committed by GitHub
parent 980aaeceb9
commit 9ded71f2bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View File

@ -486,10 +486,15 @@ def gen_invaild_search_params_type():
def gen_search_param(index_type, metric_type="L2"):
search_params = []
if index_type in ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ"]:
for nprobe in [64, 128]:
ivf_search_params = {"metric_type": metric_type, "params": {"nprobe": nprobe}}
if index_type in ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "GPU_FLAT", "GPU_IVF_FLAT", "GPU_IVF_PQ", "GPU_IVF_SQ8",
"RAFT_IVF_FLAT", "RAFT_IVF_PQ"]:
if index_type in ["GPU_FLAT"]:
ivf_search_params = {"metric_type": metric_type, "params": {}}
search_params.append(ivf_search_params)
else:
for nprobe in [64, 128]:
ivf_search_params = {"metric_type": metric_type, "params": {"nprobe": nprobe}}
search_params.append(ivf_search_params)
elif index_type in ["BIN_FLAT", "BIN_IVF_FLAT"]:
if metric_type not in ct.binary_metrics:
log.error("Metric type error: binary index only supports distance type in (%s)" % ct.binary_metrics)

View File

@ -187,7 +187,7 @@ all_index_types = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "ANNOY", "DI
default_index_params = [{"nlist": 128}, {"nlist": 128}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8},
{"M": 48, "efConstruction": 500}, {"n_trees": 50}, {}, {"nlist": 128}, {"nlist": 128},
{"nlist": 128}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8}, {"nlist": 128},
{}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8}, {"nlist": 128},
{"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8}]
Handler_type = ["GRPC", "HTTP"]

View File

@ -5164,14 +5164,14 @@ class TestCollectionRangeSearch(TestcaseBase):
"ids": [],
"limit": 0})
# 4. range search with IP
range_search_params = {"metric_type": "IP", "params": {"nprobe": 10, "radius": 1}}
range_search_params = {"metric_type": "IP", "params": {"nprobe": 10, "radius": 0}}
collection_w.search(vectors[:default_nq], default_search_field,
range_search_params, default_limit,
default_search_exp,
check_task=CheckTasks.check_search_results,
check_items={"nq": default_nq,
"ids": [],
"limit": 0})
"ids": insert_ids,
"limit": default_limit})
@pytest.mark.tags(CaseLabel.L2)
def test_range_search_radius_range_filter_not_in_params(self):