feat(dataset): add synonym management and search enhancement - #7558
feat(dataset): add synonym management and search enhancement#7558lean-zone wants to merge 2 commits into
Conversation
|
zhanglin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
| export const DatasetSynonymMappingCollectionName = 'dataset_synonym_mappings'; | ||
| export const DatasetSynonymJobCollectionName = 'dataset_synonym_jobs'; | ||
| export const DatasetSynonymOperationCollectionName = 'dataset_synonym_operations'; | ||
| export const DatasetMutationLockCollectionName = 'dataset_mutation_locks'; |
|
✅ Build and publish successful - Preview fastgpt Image: 🕒 Time: 2026-09-05 11:18:41 (UTC+8) |
|
这期建议先收敛范围,只实现同义词能力,不在这个 PR 里同时建设一套新的训练/重构队列。 具体调整建议:
因此数据结构可以先简化为同义词配置/映射集合,加已有的 训练/重构队列的通用可靠性问题——例如任务幂等、租约续期、崩溃恢复、向量写入补偿、计费去重和统一进度模型——后续单独开需求统一优化,避免只为同义词做一套专用实现。 |
|
补充本次 review 发现的其他问题。即使按上一条建议简化方案,下面第一组仍需要处理。 简化后仍需修复
如果仍保留当前复杂队列方案,还存在以下阻塞问题
如果按上一条评论删除专用 operation、rollback 和 mutation lock,上述第二组不需要逐项修补;应随相关实现一起移除。 |
707a1fd to
2bcc980
Compare
|
导入和 rebuild 尽量简单、复用原结构。 但当前mutation 自己实现了配置锁、版本快照、全量扫描、批量入队、失败清理和 matcher 缓存。尤其训练队列方面,当前没有充分处理与原有训练任务并存的情况。mutation 复用了旧训练队列 worker,但没有完全复用旧的训练任务创建/rebuild 编排结构,保持精简 |
1612d88 to
9e48fff
Compare
37726d7 to
6caadd7
Compare
b73cfc9 to
66f9a46
Compare
6d52fad to
59322ef
Compare
59322ef to
9e5cb33
Compare
56fd751 to
fd0786e
Compare
fd0786e to
d7c5d15
Compare
What does this PR do?
This PR adds dataset-level synonym management and integrates synonym normalization into data indexing, retrieval, reranking, and citation metadata.
Each dataset can maintain one active synonym configuration. Synonym mappings are stored as versioned MongoDB snapshots and can be managed through JSON mappings or uploaded files.
Main changes
indexes.textvalues.synonymMappingsin existing knowledge-base citation metadata.Rebuild and consistency behavior
fileVersionto associate mappings with a complete configuration snapshot.rebuildingso the existing queue recovery and retry flow can continue.dataset.updateTimeas a dataset-wide write lock.Permissions and billing
Migration
A Mongo-only migration script is included:
The script runs in dry-run mode by default. Pass
--executeto apply changes.The migration converts legacy synonym configuration and mapping data into the current
schemaVersion=2snapshot format and is designed to be safely rerunnable.The migration should be run during downtime with application and worker processes stopped. Legacy S3 files are not deleted.
The new synonym APIs no longer use legacy S3
fileIdorpendingFileIdfields. Existing synonym data must be migrated before enabling the new implementation.Limits and matching behavior
Verification
The local targeted Vitest run may require access to download the MongoDB binary used by
mongodb-memory-server.Design document
The detailed data model, matching rules, rebuild flow, migration strategy, and compatibility constraints are documented in:
.agents/design/core/dataset/synonym-feature-design.md