import{_ as a,c as n,o as s,a as e}from"./app.32957174.js";const y='{"title":"Theme Config: Algolia Search","description":"","frontmatter":{},"headers":[{"level":2,"title":"Internationalization (i18n)","slug":"internationalization-i18n"}],"relativePath":"developer/algolia-search.md"}',t={},p=e(`

Theme Config: Algolia Search

The themeConfig.algolia option allows you to use Algolia DocSearch. To enable it, you need to provide at least appId, apiKey and indexName:

module.exports = {
  themeConfig: {
    algolia: {
      appId: 'your_app_id',
      apiKey: 'your_api_key',
      indexName: 'index_name'
    }
  }
}

For more options, check out Algolia DocSearch's documentation. You can pass any extra option alongside other options, e.g. passing searchParameters:

module.exports = {
  themeConfig: {
    algolia: {
      appId: 'your_app_id',
      apiKey: 'your_api_key',
      indexName: 'index_name',
      searchParameters: {
        facetFilters: ['tags:guide,api']
      }
    }
  }
}

Internationalization (i18n)

If you have multiple locales in your documentation and you have defined a locales object in your themeConfig:

module.exports = {
  themeConfig: {
    locales: {
      // ...
    },
    algolia: {
      appId: 'your_app_id',
      apiKey: 'your_api_key',
      indexName: 'index_name'
    }
  }
}

VitePress will automatically add a lang facetFilter to the searchParameters.facetFilter array with the correct language value. Algolia automatically adds the correct facet filter based on the lang attribute on the <html> tag. This will match search results with the currently viewed language of the page.

`,9),o=[p];function r(l,c,i,u,k,d){return s(),n("div",null,o)}var g=a(t,[["render",r]]);export{y as __pageData,g as default};