From a678adf646504682c34c900740d53a23c6878444 Mon Sep 17 00:00:00 2001 From: Viajero <2737079298@qq.com> Date: Tue, 14 Oct 2025 16:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E2=80=9C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ESConnect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ESConnect.py b/ESConnect.py index 470f354..bebfc5e 100644 --- a/ESConnect.py +++ b/ESConnect.py @@ -159,7 +159,7 @@ def update_by_id(doc_id, updated_data): """ try: # 执行更新操作 - es.update(index=index_name, id=doc_id, body={"doc": updated_data}) + es.update(index=data_index_name, id=doc_id, body={"doc": updated_data}) print(f"文档 {doc_id} 更新成功") return True except Exception as e: @@ -178,7 +178,7 @@ def get_by_id(doc_id): """ try: # 执行获取操作 - result = es.get(index=index_name, id=doc_id) + result = es.get(index=data_index_name, id=doc_id) if result['found']: return { "_id": result['_id'],