AstroNvim / docs

Site for AstroNvim
https://docs.astronvim.com
23 stars 59 forks source link

Search doesn't seem to be working. #147

Closed johnnymatthews closed 5 months ago

johnnymatthews commented 5 months ago

Checklist

Neovim version (nvim -v)

N/A. Docs site issue.

Operating system/version

N/A. Docs site issue.

Terminal/GUI

N/A. Docs site issue.

Describe the bug

The search service in docs.astronvim.com doesn't seem to be working, or at least not particulalrly well. For example, if I searched for notifications I'd expect to be lead to somewhere like /reference/default_plugins/ which mentions the nvim-notify plugin:

Screenshot 2024-04-20 at 11 44 42

However, I'm actually directed to pages containing the word modifications:

Screenshot 2024-04-20 at 11-41-41 Default Plugins

There's likely more cases of this happening. I'm assuming this is because the search service, Algolia, is only looking at headers, and not the actual content of each page.

Steps to Reproduce

  1. Go to https://docs.astronvim.com/
  2. Click the search bar.
  3. Enter notifications.
  4. See that no pages containing the word notifications are suggested by the search box.

Expected behavior

The search service should return pages containing the string that the user is searching for.

Screenshots

No response

Additional Context

Obviously, the fact that Algolia gives open-source projects free search is great! But if that search doesn't work, it might be better exploring other options? There are several available through Docusaurus, which I'm assuming is the static-site generator used for this site.

mehalter commented 5 months ago

Thanks for reporting! I'll go and force a rescan of the crawler now to see if maybe they had a bug in it. Then next week I'll take a look at the search index and try to improve the coding of it. Definitely seems very strange that it's doing this. We haven't modified it from what Algolia gave us. Also we are not using Docusaurus, we are using Astro.js and Starlight.

mehalter commented 5 months ago

Updated our crawler to include table content and code blocks.

johnnymatthews commented 5 months ago

Excellent! Thanks @mehalter!