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")