Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
6dcbcc9b
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6dcbcc9b
编写于
11月 28, 2019
作者:
J
Jin Hai
提交者:
GitHub
11月 28, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #571 from del-zhenwu/0.6.0
Add regex cases to test search partition tags in 0.6.0
上级
401715a8
19b77d1a
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
31 addition
and
0 deletion
+31
-0
tests/milvus_python_test/test_search_vectors.py
tests/milvus_python_test/test_search_vectors.py
+31
-0
未找到文件。
tests/milvus_python_test/test_search_vectors.py
浏览文件 @
6dcbcc9b
...
...
@@ -266,6 +266,37 @@ class TestSearchBase:
assert
check_result
(
result
[
1
],
new_ids
[
0
])
assert
result
[
1
][
0
].
distance
<=
epsilon
def
test_search_l2_index_params_partition_F
(
self
,
connect
,
table
,
get_simple_index_params
):
'''
target: test basic search fuction, all the search params is corrent, test all index params, and build
method: search table with the given vectors and tags with "re" expr, check the result
expected: search status ok, and the length of the result is top_k
'''
tag
=
"atag"
new_tag
=
"new_tag"
index_params
=
get_simple_index_params
logging
.
getLogger
().
info
(
index_params
)
partition_name
=
gen_unique_str
()
new_partition_name
=
gen_unique_str
()
status
=
connect
.
create_partition
(
table
,
partition_name
,
tag
)
status
=
connect
.
create_partition
(
table
,
new_partition_name
,
new_tag
)
vectors
,
ids
=
self
.
init_data
(
connect
,
partition_name
)
new_vectors
,
new_ids
=
self
.
init_data
(
connect
,
new_partition_name
,
nb
=
1000
)
status
=
connect
.
create_index
(
table
,
index_params
)
query_vec
=
[
vectors
[
0
],
new_vectors
[
0
]]
top_k
=
10
nprobe
=
1
status
,
result
=
connect
.
search_vectors
(
table
,
top_k
,
nprobe
,
query_vec
,
partition_tags
=
[
"new(.*)"
])
logging
.
getLogger
().
info
(
result
)
assert
status
.
OK
()
assert
result
[
0
][
0
].
distance
>
epsilon
assert
result
[
1
][
0
].
distance
<=
epsilon
status
,
result
=
connect
.
search_vectors
(
table
,
top_k
,
nprobe
,
query_vec
,
partition_tags
=
[
"(.*)tag"
])
logging
.
getLogger
().
info
(
result
)
assert
status
.
OK
()
assert
result
[
0
][
0
].
distance
<=
epsilon
assert
result
[
1
][
0
].
distance
<=
epsilon
def
test_search_ip_index_params
(
self
,
connect
,
ip_table
,
get_index_params
):
'''
target: test basic search fuction, all the search params is corrent, test all index params, and build
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录