modelscope / modelscope/ms-cookbook
模型仓库越来越多,搜索框 检索的速度越来越慢,20 万量级下,靠纯搜索定位不现实
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 339
- Forks
- 52
- Avg merge
- 15m
- Merged PRs (30d)
- 1
Description
原因推测:
- 数据集规模:20 万模型的元数据(含 README、标签、文件清单)远超通用搜索配置的舒适区。
- 前端请求粒度:若未做防抖,每敲一个字符触发一次全量查询,请求量呈倍数放大。
- 结果集未收敛:宽泛词命中数千条且无有效排序,传输与渲染开销巨大。
- 缺少独立的补全通道:"输入联想"与"全量搜索"共用一套重型查询
以下为 2026-09-16 通过脚本批量探测的结果,每个结论都可复现:
接口 | 方法 | 实测返回 -- | -- | -- /api/v1/models?Name=<关键词> | GET | 404 /api/v1/models/search | GET | 404 /api/v1/dolphin/models | POST | 404 /api/v1/models/{owner}/{name}/repo/files?Revision=master&Root= | GET | 200(正常可用)补充观察:
- 搜索
SDXL返回 5183 条结果,且无法按相关度/下载量/更新时间排序,等于不可用。
- 唯一稳定可用的检索方式是"点名验证":已知完整
owner/name后,用上面最后那个接口查存在性(200=存在,404=不存在)。
这说明:慢的可能不只是"响应时间长",搜索能力本身存在缺口。 建议先确认这几个端点是否已迁移或下线 —— 如果是,前端可能正在 fallback 到某种更慢的查询路径。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by verifying the listed endpoints: /api/v1/models?Name=, /api/v1/models/search, /api/v1/dolphin/models, and /api/v1/models/{owner}/{name}/repo/files. Trace which endpoint the search box currently uses and confirm whether the reported 404s indicate migration or fallback behavior. Done should include an agreed search and autocomplete design with bounded, useful results and verified behavior at the reported scale.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design, search
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100