新增“数据编辑”
This commit is contained in:
		@@ -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'],
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user