facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
56.07k stars 8.41k forks source link

v1: algolia search result display issue #6432

Closed pa-eps closed 2 years ago

pa-eps commented 2 years ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

I am using Docusaurus v1.14.7. I've been using Algolia DocSearch for awhile now and recently received email about DocSearch being migrated to their new infrastructure. That means I need to update DocSearch configuration for my site. After updating the configuration, I noticed there's an issue with the way search result is being displayed.

I think this bug is from Algolia's new index or their docsearch UI. I'm not sure where to raise this bug. This issue seems to be affecting Docusaurus v1 site also. I expect others might have the same issue.

Here's a screenshot of what the search UI looks like from Docusaurus v1 site:

image

I've highlighted the issue in the screenshot above. It seems the UI is concatenating everything from sidebars. It makes it very hard to understand where the search result is coming from compared to how it was before.

Steps to reproduce

n/a

Expected behavior

The search result UI to show results same way as it did before DocSearch migration.

Actual behavior

Search result UI has a bug. It combines everything from sidebars into the search result's UI instead of only showing the sidebar category where the result was found.

Your environment

Reproducible demo

https://v1.docusaurus.io/docs/en/site-preparation

Self-service

slorber commented 2 years ago

@shortcuts do you have any why this happens?

As far as I know we switched Docusaurus v1 site to one appId (default) to another in https://github.com/facebook/docusaurus/commit/6b9ba340201c6792c5686f0075369fff578bf903

Maybe we did something wrong and the crawler config is not exactly as before, or it is behaving differently?

shortcuts commented 2 years ago

I'd say there's an issue with the lvl0 selector, we used xPath before but the equivalent might not properly work. Checking

shortcuts commented 2 years ago

Hey

I've fixed the lvl0, you should see proper results on Docusaurus v1. The doc is also updated: https://github.com/algolia/docsearch/commit/bfde46e140d368dcebb0f424f087a27b2ce7c04f

Josh-Cena commented 2 years ago

Thanks! I can see correct output now. Will close this if there are no further problems

pa-eps commented 2 years ago

Hey

I've fixed the lvl0, you should see proper results on Docusaurus v1. The doc is also updated: algolia/docsearch@bfde46e

@shortcuts - Thanks for looking into it and the fix for Docusaurus website. As I mentioned earlier, I manage multiple sites that are based on Docusuaurus V1. How do I get this fixed for my sites? Should I be applying that change through Algolia Crawler configuration myself for each of the sites?

I'm still somewhat new to the whole setup/docsearch-migration. I'd appreciate if you could clarify. Thank you.

shortcuts commented 2 years ago

How do I get this fixed for my sites? Should I be applying that change through Algolia Crawler configuration myself for each of the sites?

Hey, I'm out of office until next Monday so I can't apply changes myself on current Docusaurus v1 crawlers. The fastest would be if you could edit your configs directly from the web interface.

cc @bodinsamuel

pa-eps commented 2 years ago

I was able to make that change. I believe other sites built using Docusuarus V1 will have to do the same.

  1. Go to crawler.algolia.com
  2. Open the crawler for your site
  3. Go into Editor
  4. Apply the change according to the one done in Docusaurus' website crawler here https://github.com/algolia/docsearch/commit/bfde46e140d368dcebb0f424f087a27b2ce7c04f
  5. Save the configuration and initiate a new crawl by clicking the "Restart crawling"

@shortcuts - When you're back, please let me know if there is anything else I need to do or if I missed anything.