GET/api/v1/document检索站内文档
Try it 面板需要启用 JavaScript。
基于构建期生成的全文索引检索站内文档资源,按相关度降序返回命中文档。Uri 相对站点根。
Request
Query Parameters
| Name | Data Type | Required | Description |
|---|---|---|---|
| keyword | string | Yes | 检索关键词 |
| limit | number | No | 返回条数上限,最大 50(默认值 20) |
type QueryParams = {
/** 检索关键词 */
keyword: string
/** 返回条数上限,最大 50,默认值 20 */
limit?: number
}{
"keyword": "错误码",
"limit": 10
}Response
Body
| Name | Data Type | Required | Description |
|---|---|---|---|
| path | string | Yes | 命中页面路径,相对站点根 |
| title | string | Yes | 页面标题 |
| excerpt | string | Yes | 命中片段,纯文本 |
| score | number | Yes | 相关度得分,数值越大越相关 |
type SearchHitDTO = {
/** 命中页面路径,相对站点根 */
path: string
/** 页面标题 */
title: string
/** 命中片段,纯文本 */
excerpt: string
/** 相关度得分,数值越大越相关 */
score: number
}{
"path": "cn/api_references/code.html",
"title": "错误码",
"excerpt": "……统一响应包装中的 code 字段含义,站点管理接口的业务错误码从 4101 起……",
"score": 42.5
}HTTP Code
原始响应,无统一包装,结果仅以 HTTP 状态码表达:
| HTTP Status | Meaning | Notes |
|---|---|---|
| 200 | 成功 | 返回命中列表 |
