Solitude Docs
集成搜索

DocSearch

连接外部搜索索引。

准备服务的应用 ID、索引名和公开搜索密钥:

// src/site.config.ts
import { defineSolitudeConfig } from './lib/config';

export default defineSolitudeConfig({
  theme: { search: {
    enable: true, type: 'docsearch',
    docsearch: { appId: 'YOUR_APP_ID', apiKey: 'YOUR_SEARCH_ONLY_KEY', indexName: 'blog' },
  } },
});

先申请 DocSearch 并配置爬虫索引,结果使用 DocSearch 的数据结构。

主题提供搜索界面,不负责创建或同步索引。仅使用公开搜索密钥;检查空结果、失败提示与生产域名。

相关文档

本地搜索