You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/algolia-search.md
+72-1
Original file line number
Diff line number
Diff line change
@@ -13,4 +13,75 @@ module.exports = {
13
13
}
14
14
```
15
15
16
-
For more options, check out [Algolia DocSearch's documentation](https://github.com/algolia/docsearch#docsearch-options).
16
+
For more options, check out [Algolia DocSearch's documentation](https://docsearch.algolia.com/docs/behavior). You can pass any extra option alongside other options, e.g. passing `searchParameters`:
17
+
18
+
```js
19
+
module.exports= {
20
+
themeConfig: {
21
+
algolia: {
22
+
apiKey:'your_api_key',
23
+
indexName:'index_name',
24
+
searchParameters: {
25
+
facetFilters: ['tags:guide,api']
26
+
}
27
+
}
28
+
}
29
+
}
30
+
```
31
+
32
+
## Internationalization (i18n)
33
+
34
+
If you have multiple locales in your documentation and you have defined a `locales` object in your `themeConfig`:
35
+
36
+
```js
37
+
module.exports= {
38
+
themeConfig: {
39
+
locales: {
40
+
// ...
41
+
},
42
+
algolia: {
43
+
apiKey:'your_api_key',
44
+
indexName:'index_name'
45
+
}
46
+
}
47
+
}
48
+
```
49
+
50
+
VitePress will automatically add a `language`_facetFilter_ to the `searchParams.facetFilter` array with the correct language value. **Make sure to properly configure your DocSearch config as well** by adding `language` as a _custom attribute for faceting_ and by setting it based on the `lang` attribute of the `<html>` element. Here is a short example of DocSearch config:
You can take a look at the [DocSearch config used by Vue Router](https://github.com/algolia/docsearch-configs/blob/master/configs/next_router_vuejs.json) for a complete example.
0 commit comments