feat(knowledge-base): 添加知识库文件全库检索功能

- 新增相对路径字段替代原有的metadata存储方式
- 实现跨知识库文件检索接口searchFiles
- 添加前端全库检索页面和相关API调用
- 优化文件路径处理和数据库索引配置
- 统一请求参数类型定义为RequestPayload和RequestParams
- 简化RagFile模型中的元数据结构设计
This commit is contained in:
2026-01-30 22:23:52 +08:00
parent cbad129ce4
commit 76f70a6847
14 changed files with 403 additions and 83 deletions

View File

@@ -18,6 +18,7 @@ create table if not exists t_rag_file
id VARCHAR(36) PRIMARY KEY COMMENT 'UUID',
knowledge_base_id VARCHAR(36) NOT NULL COMMENT '知识库ID',
file_name VARCHAR(255) NOT NULL COMMENT '文件名',
relative_path VARCHAR(512) NULL COMMENT '相对路径',
file_id VARCHAR(255) NOT NULL COMMENT '文件ID',
chunk_count INT COMMENT '切片数',
metadata JSON COMMENT '元数据',
@@ -28,3 +29,6 @@ create table if not exists t_rag_file
created_by VARCHAR(255) COMMENT '创建者',
updated_by VARCHAR(255) COMMENT '更新者'
) comment '知识库切片表';
create index idx_rag_file_kb_name on t_rag_file (knowledge_base_id, file_name);
create index idx_rag_file_kb_path on t_rag_file (knowledge_base_id, relative_path);