mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 19:39:21 +08:00
Fix compile error
This commit is contained in:
parent
25d18944f8
commit
5b14d5ca2d
@ -9,7 +9,7 @@ class VectorEngine(object):
|
||||
@staticmethod
|
||||
def AddGroup(group_id):
|
||||
group = GroupTable.query.filter(GroupTable.group_name==group_id).first()
|
||||
if(group):
|
||||
if group:
|
||||
return jsonify({'code': 1, 'group_name': group_id, 'file_number': group.file_number})
|
||||
else:
|
||||
new_group = GroupTable(group_id)
|
||||
@ -20,7 +20,7 @@ class VectorEngine(object):
|
||||
@staticmethod
|
||||
def GetGroup(group_id):
|
||||
group = GroupTable.query.filter(GroupTable.group_name==group_id).first()
|
||||
if(group):
|
||||
if group:
|
||||
return jsonify({'code': 0, 'group_name': group_id, 'file_number': group.file_number})
|
||||
else:
|
||||
return jsonify({'code': 1, 'group_name': group_id, 'file_number': 0}) # not found
|
||||
@ -53,9 +53,9 @@ class VectorEngine(object):
|
||||
@staticmethod
|
||||
def AddVector(group_id, vector):
|
||||
print(group_id, vector)
|
||||
file = FileTable.query.filter(and_(FileTable.group_name == group_id, FileTable.type == 'raw').first()
|
||||
if (file):
|
||||
if(file.row_number >= ROW_LIMIT):
|
||||
file = FileTable.query.filter(and_(FileTable.group_name == group_id, FileTable.type == 'raw')).first()
|
||||
if file:
|
||||
if file.row_number >= ROW_LIMIT:
|
||||
# create index
|
||||
index_filename = file.filename + "_index"
|
||||
CreateIndex(group_id, index_filename)
|
||||
@ -103,4 +103,4 @@ class VectorEngine(object):
|
||||
@staticmethod
|
||||
def InsertVectorIntoRawFile(filename, vector):
|
||||
print(sys._getframe().f_code.co_name)
|
||||
return filename
|
||||
return filename
|
||||
|
Loading…
Reference in New Issue
Block a user