From 1b5800c788e8c9277a23f76666abc1b757d56b42 Mon Sep 17 00:00:00 2001
From: zrj <646384940@qq.com>
Date: Fri, 14 Jun 2024 15:53:25 +0800
Subject: [PATCH] 线上 es 全文检索升级到8.14.1 版本导致数据更新异常调整(不抛出异常),实际数据已经被操作
---
src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java b/src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java
index 41eb0ad..0be652d 100644
--- a/src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java
+++ b/src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java
@@ -173,9 +173,9 @@
// 刷新索引,确保文档可搜索
client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
- System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
+// System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
}
}
// 返回
@@ -226,9 +226,9 @@
// 刷新索引,确保文档可搜索
client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
- System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
+// System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
}
}
// 返回
@@ -278,9 +278,9 @@
// 刷新索引,确保文档可搜索
client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
- System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
+// System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
}
}
// 返回
@@ -329,9 +329,9 @@
// 刷新索引,确保文档可搜索
client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
- System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
+// System.out.println("批量插入结果: " + !bulkResponse.hasFailures());
}
}
// 返回
@@ -363,7 +363,7 @@
"articleType", article.getArticleType()
);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
}
}
@@ -389,7 +389,7 @@
"communityCode", placeService.getCommunityCode(place.getId())
);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
}
}
@@ -415,7 +415,7 @@
"communityCode", houseService.getCommunityCode(house.getId())
);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
}
}
@@ -442,7 +442,7 @@
"communityCode", householdService.getCommunityCode(household.getId())
);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
}
}
@@ -619,9 +619,9 @@
// 输出操作结果
boolean acknowledged = deleteResponse.isAcknowledged();
- System.out.println("索引删除成功: " + acknowledged);
+// System.out.println("索引删除成功: " + acknowledged);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
}
}
@@ -639,7 +639,7 @@
try {
indexDocument(esParam.getIndexName(), str);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
return true;
}
@@ -689,7 +689,7 @@
// 刷新索引,确保文档可搜索
client.indices().refresh(new RefreshRequest(esParam.getIndexName()), RequestOptions.DEFAULT);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
}
}
@@ -773,7 +773,7 @@
BulkByScrollResponse bulkResponse =
client.deleteByQuery(deleteByQueryRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
- e.printStackTrace();
+// e.printStackTrace();
}
}
return true;
--
Gitblit v1.9.3