diff --git a/app/api/search.py b/app/api/search.py index 2794980..4def726 100644 --- a/app/api/search.py +++ b/app/api/search.py @@ -22,8 +22,8 @@ def search_docs(request: QueryRequest, user_id: str = Query(..., description=" try: logger.info(f"Received search request from user: {user_id} with query: {request.query}") - # 修正后的索引路径,使用用户ID并且不带 ".index" 后缀 - index_path = os.path.join("index_data", user_id) # 仅使用 user_id 作为文件夹名 + # 修正后的索引路径,确保指向具体的 index.faiss 文件 + index_path = os.path.join("index_data", user_id, "index.faiss") # 指向文件,而非目录 logger.info(f"Looking for index at path: {index_path}") # 检查索引是否存在