整理es相关代码;增加手动调试用接口

This commit is contained in:
liu.zixi
2025-10-13 14:59:56 +08:00
parent 3056921ba6
commit 4aea688693
6 changed files with 215 additions and 112 deletions

View File

@@ -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();
}
}
}