# 搜索文档 (/zh/api/assistant/search)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 735 · updated: 2026-07-30 -->
Related: [创建 assistant 消息](/zh/api/assistant/create-assistant-message-v2.md), [获取页面内容](/zh/api/assistant/get-page-content.md)

<div id="rate-limits">
  ## 速率限制 [#速率限制]
</div>

* 每个 Mintlify 组织每小时 10,000 次请求

`POST /v1/search/{domain}`

在你的文档中执行语义搜索和关键词搜索，并支持可配置的过滤和分页。

使用 assistant API 密钥进行身份验证。搜索请求不消耗额度。

## OpenAPI

```json
{
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "来自你的 `domain.mintlify.site` URL 的域名标识符。可以在控制台 URL 的末尾找到。例如，`dashboard.mintlify.com/organization/domain` 的域名标识符就是 `domain`。"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "query"
          ],
          "properties": {
            "query": {
              "type": "string",
              "description": "在文档内容中要执行的搜索查询。"
            },
            "pageSize": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 50,
              "description": "要返回的搜索结果数量。必须在 1 到 50 之间。若未指定，默认为 10。"
            },
            "scoreThreshold": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "description": "结果的最低相关性分数。仅返回分数等于或高于此阈值的结果。必须介于 0 和 1 之间。"
            },
            "filter": {
              "type": "object",
              "description": "用于缩小搜索结果范围的可选过滤参数。",
              "properties": {
                "version": {
                  "type": "string",
                  "description": "按文档版本筛选结果。"
                },
                "language": {
                  "type": "string",
                  "description": "按内容语言筛选结果。"
                },
                "tag": {
                  "type": "string",
                  "description": "按标签筛选结果。"
                },
                "groups": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "调用方获授权访问的可选文档分组。当部署启用 `auth` 或 `userAuth` 时，结果仅限于指定分组可查看的页面。在受保护的部署上如果省略或为空，则结果仅包含公开页面。"
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "搜索结果",
      "content": {
        "application/json": {
          "schema": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "string",
                  "description": "来自文档中匹配的内容。"
                },
                "path": {
                  "type": "string",
                  "description": "源文档所在的路径或 URL。"
                },
                "metadata": {
                  "type": "object",
                  "description": "与搜索结果相关的附加 metadata。"
                }
              }
            }
          }
        }
      }
    }
  }
}
```
