global-search-api/README-V2.md
Guanghu Domestic Migration b69c03d60e chore: import sanitized domestic snapshot for REPO-003
Source snapshot: fa832f2f8245afdaf013ed8a1f689152972386b5
2026-07-17 15:55:11 +08:00

32 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 光湖全局检索 API V2
V2 是给外部通用 AI 的公开只读入口。它先读取第五域广播塔登记的 `world-router.json`,再决定该去哪个仓库、哪个人格体路径或哪份 GLS 架构资料。
## 先找路,再读文件
```text
GET /v2/resolve?q=铸渊
GET /v2/context?q=GLSV
GET /v2/search?repo=fifth-domain&q=HLDP
GET /v2/file?repo=fifth-domain&path=gls/GLS-ENTRY.hdlp
```
`/v2/repos` 会列出八个登记仓库,并明确显示某仓库是否已经挂载到检索服务器。每一份结果都会带上仓库提交号,避免把旧副本误当成当前内容。
## 边界
- V2 只有 `GET` / `OPTIONS`,没有写入、提交、握手或公开密码入口。
- 服务器部署、拉取与重启不属于这里仍由“光湖系统安全验证GLSV”处理。
- `world-router.json` 的权威来源是第五域广播塔;服务器通过 `WORLD_ROUTER_PATH``/opt/zhuyuan/fifth-domain/world-router.json` 读取它。
## 启动(服务器)
```bash
WORLD_ROUTER_PATH=/opt/zhuyuan/fifth-domain/world-router.json \
REPO_ROOT=/opt/zhuyuan PORT=3951 python3 server_v2.py
```
反向代理建议把公开的 `/global-search/v2/` 指到该进程,并保留旧版 `/global-search/` 原样运行,直到 V2 验收完成。
具体的并行上线与验收步骤见 `DEPLOY-V2.md`