From b1b0bf6fd68cc1256dda72fc054f8917d473eb52 Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Mon, 3 Jul 2023 15:30:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=87=BA=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E4=B8=BA0=E6=97=B6=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controller/EmbeddingSearch.py | 6 +++--- service/embedding_search.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/controller/EmbeddingSearch.py b/api/controller/EmbeddingSearch.py index 0984ecd..0545246 100644 --- a/api/controller/EmbeddingSearch.py +++ b/api/controller/EmbeddingSearch.py @@ -87,7 +87,7 @@ class EmbeddingSearch: "status": -2, "message": error_msg, "error": { - "code": "page_not_found", + "code": "page-not-found", "title": page_title, }, }) @@ -115,7 +115,7 @@ class EmbeddingSearch: "status": -4, "message": error_msg, "error": { - "code": "page_index_running", + "code": "page-index-running", }, }) if transatcion_id: @@ -129,7 +129,7 @@ class EmbeddingSearch: "status": -1, "message": error_msg, "error": { - "code": "internal_server_error", + "code": "internal-server-error", } }) if transatcion_id: diff --git a/service/embedding_search.py b/service/embedding_search.py index aeff29c..7c41774 100644 --- a/service/embedding_search.py +++ b/service/embedding_search.py @@ -283,6 +283,9 @@ class EmbeddingSearchService: in_collection: bool = False, distance_limit: float = 0.6, ): + if limit == 0: + return [], 0 + if self.page_index is None: raise Exception("Page index is not initialized")