Examples and extensions
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
These examples are interactive. Click a button to open the modal and try a query.
基本关键词搜索
Use the default experience with your index credentials. This works great for typical docs, blogs, and any site with a DocSearch-compliant index.
<DocSearch
appId="PMZUYBQDAK"
apiKey="24b09689d5b4223813d9b8e48563c8f6"
indexName="docsearch"
insights={true}
translations={{ button: { buttonText: 'keyword search (demo)' } }}
/>
Ask AI:AI 辅助回答
Add Algolia Ask AI to get synthesized answers grounded in your indexed content. You can scope the LLM context using searchParameters like facetFilters, filters, attributesToRetrieve,restrictSearchableAttributes, and distinct.
<DocSearch
appId="PMZUYBQDAK"
apiKey="24b09689d5b4223813d9b8e48563c8f6"
indexName="docsearch"
askAi={{
assistantId: 'askAIDemo',
searchParameters: {
facetFilters: ['language:en'],
},
}}
insights={true}
translations={{ button: { buttonText: 'search with askai (demo)' } }}
/>
侧边栏:持久化 AI 聊天
侧边栏提供固定在页面边缘的持久化聊天界面,特别适合文档类网站——用户可在不离开当前浏览位置的情况下进行追问。点击屏幕右下角的按钮即可体验演示功能。
<DocSearchSidepanel
appId="PMZUYBQDAK"
apiKey="24b09689d5b4223813d9b8e48563c8f6"
indexName="docsearch"
assistantId="askAIDemo"
/>