优化导出数量为0时的操作

master
落雨楓 2 years ago
parent 80ad7223c1
commit b1b0bf6fd6

@ -87,7 +87,7 @@ class EmbeddingSearch:
"status": -2, "status": -2,
"message": error_msg, "message": error_msg,
"error": { "error": {
"code": "page_not_found", "code": "page-not-found",
"title": page_title, "title": page_title,
}, },
}) })
@ -115,7 +115,7 @@ class EmbeddingSearch:
"status": -4, "status": -4,
"message": error_msg, "message": error_msg,
"error": { "error": {
"code": "page_index_running", "code": "page-index-running",
}, },
}) })
if transatcion_id: if transatcion_id:
@ -129,7 +129,7 @@ class EmbeddingSearch:
"status": -1, "status": -1,
"message": error_msg, "message": error_msg,
"error": { "error": {
"code": "internal_server_error", "code": "internal-server-error",
} }
}) })
if transatcion_id: if transatcion_id:

@ -283,6 +283,9 @@ class EmbeddingSearchService:
in_collection: bool = False, in_collection: bool = False,
distance_limit: float = 0.6, distance_limit: float = 0.6,
): ):
if limit == 0:
return [], 0
if self.page_index is None: if self.page_index is None:
raise Exception("Page index is not initialized") raise Exception("Page index is not initialized")

Loading…
Cancel
Save