mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-14 13:26:49 +08:00
整理es相关代码;增加手动调试用接口
This commit is contained in:
@@ -26,12 +26,11 @@ public class ElasticSearchIndexInitializer {
|
||||
*/
|
||||
@EventListener(ApplicationReadyEvent.class)
|
||||
public void initializeElasticSearchIndices() {
|
||||
String indexName = "ai_chat_messages";
|
||||
if (elasticSearchIndexService.checkIndexExists(indexName)) {
|
||||
if (elasticSearchIndexService.checkIndexExists()) {
|
||||
log.info("ElasticSearch索引 ai_chat_messages 已存在");
|
||||
} else {
|
||||
log.info("ElasticSearch索引 ai_chat_messages 不存在,开始创建...");
|
||||
elasticSearchIndexService.createIndex(indexName);
|
||||
elasticSearchIndexService.createIndex();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user