> ## Documentation Index
> Fetch the complete documentation index at: https://www.mintlify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 修复站内搜索无结果的问题

> 排查文档站点内置搜索对任何查询都不返回结果的原因，通常由 docs.json 中某个版本上的 hidden: true 设置导致。

如果你的 Mintlify 文档站点的内置搜索对任何查询（包括精确的页面标题）都不返回结果，很可能是 `docs.json` 中的某个 `hidden` 设置将你的页面从搜索索引中排除了。

<div id="check-for-hidden-true-on-a-version-or-other-top-level-navigation-element">
  ## 检查版本或其他顶层导航元素上的 `hidden: true`
</div>

在 `docs.json` 中的版本、锚点、下拉菜单、语言或产品上设置 `hidden: true`，会将其下的所有页面从搜索索引中排除。如果该元素包含你的全部页面（例如你唯一的版本），搜索索引就会变为空，所有搜索都不会返回任何结果。站点本身仍可正常访问，因为隐藏页面依然可以通过直接 URL 打开。

```json Example: this hides every page from search theme={null}
"navigation": {
  "versions": [
    {
      "version": "v1",
      "hidden": true,
      "groups": [...]
    }
  ]
}
```

要修复此问题，请选择以下方式之一：

* 从该版本或其他元素中移除 `hidden: true`。
* 保持该元素在导航中隐藏，但通过在 `docs.json` 中设置 `seo.indexing: "all"` 将其页面恢复到搜索和索引中：

  ```json theme={null}
  "seo": {
    "indexing": "all"
  }
  ```

标签页和分组支持 `searchable: true` 这一选择性加入方式，版本和其他顶层导航元素不支持。有关每种 `hidden` 位置的完整可见性和索引行为，请参见[隐藏页面](/docs/zh/organize/hidden-pages#search-seo-and-ai-indexing)。

站点重新构建时会重新编入搜索索引，因此请推送 `docs.json` 的更改，并等待部署完成后再重新测试。

<div id="other-causes">
  ## 其他原因
</div>

* **隐藏的标签页或分组**：在标签页或分组上设置 `hidden: true` 同样会将其页面从搜索中排除。对于标签页和分组，你可以在 `hidden: true` 之外同时添加 `searchable: true`，让其子页面仍可被搜索。参见[仅包含特定隐藏标签页或分组下的页面](/docs/zh/organize/hidden-pages#include-pages-under-specific-hidden-tabs-or-groups)。
* **页面未列入导航**：对于未列入 `docs.json` 导航的页面，Mintlify 默认会将其从搜索中排除。
* **页面 frontmatter**：页面 frontmatter 中的 `hidden: true`、`noindex: true` 或 `searchable: false` 都会将该页面从站内搜索中排除。


## Related topics

- [隐藏页面](/docs/zh/organize/hidden-pages.md)
- [SEO（搜索引擎优化）](/docs/zh/optimize/seo.md)
- [Mintlify CLI 命令参考](/docs/zh/cli/commands.md)
