APIリファレンス
このページは PageTurner AI で翻訳されました(ベータ版)。プロジェクト公式の承認はありません。 エラーを見つけましたか? 問題を報告 →
- JavaScript
- React
container
type: string | HTMLElement| required
The container for the DocSearch search box. You can either pass a CSS selector or an Element. If there are several containers matching the selector, DocSearch picks up the first one.
environment
type: typeof window|default: window| optional
The environment in which your application is running.
This is useful if you’re using DocSearch in a different context than window.
appId
type: string| 必須
AlgoliaアプリケーションIDです。
apiKey
type: string| 必須
Algolia Search APIキーです。
indices
type: Array<string | DocSearchIndex>
キーワード検索に使用するインデックスとそのオプションのsearchParametersのリストです。
リスト内の順序は重要です。検索結果はindicesの順序に基づいて表示されます。
indexNameは非推奨となっていますが、indicesかindexNameのどちらかを渡す必要があります。両方とも渡さない場合、Errorがスローされます。
- JavaScript
- React
docsearch({
// ...
indices: ['YOUR_ALGOLIA_INDEX'],
// ...
});
in case you want to use custom searchParameters for the index
docsearch({
// ...
indices: [
{
name: 'YOUR_ALGOLIA_INDEX',
searchParameters: {
facetFilters: ['language:en'],
// ...
},
},
],
// ...
});
<DocSearch
// ...
indices={['YOUR_ALGOLIA_INDEX']}
// ...
/>
in case you want to use custom searchParameters for the index
<DocSearch
// ...
indices={[
{
name: 'YOUR_ALGOLIA_INDEX',
searchParameters: {
facetFilters: ['language:en'],
// ...
},
},
]}
// ...
/>