Algolia search results in 404 page
joeldenning opened this issue · comments
Algolia doesn't reload the page when it navigates to a page found via the main search bar. Instead calls window.history.pushState()
(or similar via react-router). The urls that it links you to have the .html
extension which is defunct as of docusaurus v2. A page reload triggers the redirect to the page without the .html
extension, but that doesn't happen unless the user manually reloads the page.
Any ideas on how to fix this @endiliey or @lex111? Is there an algoliaOption that can be set in docusaurus.config.js to force it to reload the page? Or is there a way to clear out the search index that Algolia has created for when we were using v1?
ah need to update docsearch config then. cc @s-pace
Example algolia/docsearch-configs#1165
As workaround you can swizzle the SearchBar from algolia and remove the handleSelected https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.js
Resolved :)
Wow, thanks! Just checked it and it worked.