Repository navigation
Description
🐛 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" />
Activity
s-pace commentedon Sep 2, 2020
If you want to add several values for a specific meta tag, you will need to follow this template:
Please note the use of single quote and double quote. The value of the
contentattribute must be a valid JSON.We should create an alias for searching last version of docs on DocSe…
slorber commentedon Sep 2, 2020
Thanks @s-pace , giving it a try here: #3393
Can we sync on Discord? Once I merge it, we should trigger docusaurus site reindexation otherwise site search would be broken.
Also not sure if this is what you want?
s-pace commentedon Sep 2, 2020
Followed up on Discord. We need simple quote here.
fix(v2): DocSearch should keep working after a new release (#3393)
slorber commentedon Sep 3, 2020
So, it seems it worked, search is not broken just after the alpha 63 release :)
Next will be contextual search: #3396
fix(v2): DocSearch should keep working after a new release (meta#3393)