Skip to content

Algolia search broken after new release #3391

@slorber

Description

@slorber

🐛 Bug Report

Everytime we publish a new Docusaurus release, the Algolia search fets broken for a while, until the new version is indexed.

@s-pace said:

@Sebastien Lorber the docusaurus v2 website is now crawled every 24h. For informative purposes only, the crawl is happening from 6AM to 10AM CEST. 

The search breaks every-time there is a new release because it creates a new version. This version is extracted from the DocSearch meta tags by the crawler. This new version needs to be indexed first before to be searchable.

@francoischalifour said a temporary solution would be to send an empty PR to https://github.com/algolia/docsearch-configs/blob/master/configs/docusaurus-2.json: as they merge it, it would trigger site reindexation


This problem is likely because we use a new facet due to the new release:

      searchParameters: {
        facetFilters: [`version:${versions[0]}`],
      },

I think we should find a way to keep the facet filter constant so that search does not break.


Implementation idea: using "version aliases" (does not exist yet: #3285), so the latest version would always be at /docs/latest, and we could use a constant facet instead:

      searchParameters: {
        facetFilters: [`version:latest`],
      },

So when we publish a new version, search will temporarily be a bit stale, but won't break.


In the meantime, @s-pace @francoischalifour do you know if it's possible to add the "docsearch:version header multiple times?

If yes we could also do this on pages of the latest version:

<meta name="docsearch:version" content="2.0.0-alpha.62" />
<meta name="docsearch:version" content="latest" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions