Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_35024513
milvus
提交
dadf9734
milvus
项目概览
qq_35024513
/
milvus
与 Fork 源项目一致
Fork自
milvus / milvus
通知
14
Star
0
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,发现更多精彩内容 >>
提交
dadf9734
编写于
3月 27, 2019
作者:
J
jinhai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update interface, part2
上级
2542f67c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
6 addition
and
4 deletion
+6
-4
pyengine/engine/controller/tests/test_vector_engine.py
pyengine/engine/controller/tests/test_vector_engine.py
+1
-1
pyengine/engine/controller/tests/test_views.py
pyengine/engine/controller/tests/test_views.py
+1
-1
pyengine/engine/controller/vector_engine.py
pyengine/engine/controller/vector_engine.py
+1
-2
pyengine/engine/controller/views.py
pyengine/engine/controller/views.py
+3
-0
未找到文件。
pyengine/engine/controller/tests/test_vector_engine.py
浏览文件 @
dadf9734
...
...
@@ -71,7 +71,7 @@ class TestVectorEngine:
# Check search vector interface
code
,
vector_id
=
VectorEngine
.
SearchVector
(
'test_group'
,
self
.
__vector
,
self
.
__limit
)
assert
code
==
VectorEngine
.
SUCCESS_CODE
assert
vector_id
==
{
0
}
assert
vector_id
==
[
0
]
# Check create index interface
code
=
VectorEngine
.
CreateIndex
(
'test_group'
)
...
...
pyengine/engine/controller/tests/test_views.py
浏览文件 @
dadf9734
...
...
@@ -71,7 +71,7 @@ class TestViews:
resp
=
test_client
.
get
(
'/vector/search/6'
,
data
=
json
.
dumps
(
limit
),
headers
=
TestViews
.
HEADERS
)
assert
resp
.
status_code
==
200
assert
self
.
loads
(
resp
)[
'code'
]
==
0
assert
self
.
loads
(
resp
)[
'vector_id'
]
==
0
assert
self
.
loads
(
resp
)[
'vector_id'
]
==
[
0
]
resp
=
test_client
.
delete
(
'/vector/group/6'
,
headers
=
TestViews
.
HEADERS
)
assert
resp
.
status_code
==
200
...
...
pyengine/engine/controller/vector_engine.py
浏览文件 @
dadf9734
...
...
@@ -145,7 +145,6 @@ class VectorEngine(object):
return
VectorEngine
.
GROUP_NOT_EXIST
,
{}
group
=
GroupTable
.
query
.
filter
(
GroupTable
.
group_name
==
group_id
).
first
()
# find all files
files
=
FileTable
.
query
.
filter
(
FileTable
.
group_name
==
group_id
).
all
()
index_keys
=
[
i
.
filename
for
i
in
files
if
i
.
type
==
'index'
]
...
...
@@ -159,7 +158,7 @@ class VectorEngine(object):
vectors
.
append
(
vector
)
result
=
scheduler_instance
.
Search
(
index_map
,
vectors
,
limit
)
vector_id
=
{
0
}
vector_id
=
[
0
]
return
VectorEngine
.
SUCCESS_CODE
,
vector_id
...
...
pyengine/engine/controller/views.py
浏览文件 @
dadf9734
...
...
@@ -3,6 +3,7 @@ from flask_restful import Resource, Api
from
engine
import
app
,
db
from
engine.model.group_table
import
GroupTable
from
engine.controller.vector_engine
import
VectorEngine
import
json
# app = Flask(__name__)
api
=
Api
(
app
)
...
...
@@ -34,7 +35,9 @@ class VectorSearch(Resource):
print
(
'limit: '
,
args
[
'limit'
])
# go to search every thing
code
,
vector_id
=
VectorEngine
.
SearchVector
(
group_id
,
args
[
'vector'
],
args
[
'limit'
])
print
(
'vector_id: '
,
vector_id
)
return
jsonify
({
'code'
:
code
,
'vector_id'
:
vector_id
})
#return jsonify(})
class
Index
(
Resource
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录