Examples and extensions
These examples are interactive. Click a button to open the modal and try a query.
Basic keyword search
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-assisted answers
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)' } }}
/>