Skip to content

feat(docs): replace local lunr search with Algolia DocSearch - #81894

Merged
teknium1 merged 1 commit into
mainfrom
feat/docs-algolia-docsearch
Aug 8, 2026
Merged

teknium1 merged 1 commit into
mainfrom
feat/docs-algolia-docsearch

Conversation

@teknium1

@teknium1 teknium1 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Docs search now runs on Algolia DocSearch — no more 16 MB client-side lunr index downloaded and hydrated by every visitor before their first result.

Follows #81744 (deploy-skew asset retention): that fix stopped search from hard-404ing, this one removes the remaining slowness and takes search off our lazy-loaded JS entirely. Results now come from Algolia's servers: instant at any docs size, on any connection.

Changes

  • website/docusaurus.config.ts: drop the @easyops-cn/docusaurus-search-local theme entry; add themeConfig.algolia (public search-only credentials — the admin key is not in the repo). contextualSearch: true scopes results to the active locale via the crawler's docusaurus_tag/lang facets.
  • website/package.json + lockfile: remove @easyops-cn/docusaurus-search-local (Algolia support is built into the classic theme; no new dependency).

Validation

Check Result
Algolia index live (queried REST API directly) ✅ 9,404 records; telegram → 374 hits, correct URLs, both locales
Full local build (en + zh-Hans) with npm 12 ✅ SUCCESS
search-index.json gone from build output ✅ absent in build/ and build/zh-Hans/
DocSearch wired into built HTML (appId present)

Crawler note: the initial test crawl (300-URL cap) already produced 9,404 records covering both locales; Algolia's scheduled crawl maintains the index from here. Optional follow-up in crawler config: exclude the ~500 auto-generated per-skill catalog pages from indexing (same noise-reduction the local plugin's ignoreFiles did).

Infographic

Docs search: 16 MB local index before, server search after

The local-search plugin shipped a ~16 MB client-side lunr index that
every visitor downloaded and hydrated before their first result — slow
on any connection, painful on poor ones, and another lazy-loaded chunk
that died during deploy skew windows. DocSearch answers from Algolia's
servers: no client index, instant results at any docs size.

- themeConfig.algolia with public search-only credentials (admin key is
  not in the repo); contextualSearch keeps en/zh-Hans results separated
  via the crawler's docusaurus_tag facets
- drop @easyops-cn/docusaurus-search-local from package.json + lockfile
- index live and verified: 9,404 records, query 'telegram' returns 374
  hits with correct URLs
@teknium1
teknium1 requested a review from a team August 8, 2026 17:47
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on c8afafa

⚠️ Action required

package-lock.json · View job

Locked npm dependency versions changed.

website/package-lock.json

Package Before After
➖ @easyops-cn/autocomplete.js 0.38.1
➖ @easyops-cn/docusaurus-search-local 0.55.2
➖ cheerio (nested under @easyops-cn/docusaurus-search-local) 1.2.0
➖ entities (nested under @easyops-cn/docusaurus-search-local) 7.0.1
➖ fs-extra (nested under @easyops-cn/docusaurus-search-local) 10.1.0
➖ htmlparser2 (nested under @easyops-cn/docusaurus-search-local) 10.1.0
➖ @emnapi/core 1.11.2
➖ @emnapi/runtime 1.11.2
➖ @emnapi/wasi-threads 1.2.2
➖ @napi-rs/wasm-runtime 0.2.12
➖ @node-rs/jieba 1.10.4
➖ @node-rs/jieba-android-arm-eabi 1.10.4
➖ @node-rs/jieba-android-arm64 1.10.4
➖ @node-rs/jieba-darwin-arm64 1.10.4
➖ @node-rs/jieba-darwin-x64 1.10.4
➖ @node-rs/jieba-freebsd-x64 1.10.4
➖ @node-rs/jieba-linux-arm-gnueabihf 1.10.4
➖ @node-rs/jieba-linux-arm64-gnu 1.10.4
➖ @node-rs/jieba-linux-arm64-musl 1.10.4
➖ @node-rs/jieba-linux-x64-gnu 1.10.4
➖ @node-rs/jieba-linux-x64-musl 1.10.4
➖ @node-rs/jieba-wasm32-wasi 1.10.4
➖ @node-rs/jieba-win32-arm64-msvc 1.10.4
➖ @node-rs/jieba-win32-ia32-msvc 1.10.4
➖ @node-rs/jieba-win32-x64-msvc 1.10.4
➖ @tybys/wasm-util 0.10.3
➖ comlink 4.4.2
➖ encoding-sniffer 0.2.1
➖ immediate 3.3.0
➖ klaw-sync 6.0.0
➖ lunr 2.3.9
➖ lunr-languages 1.20.0
➖ mark.js 8.11.1
➖ parse5-parser-stream 7.1.2
➖ undici 7.28.0
➖ whatwg-encoding 3.1.1
➖ whatwg-mimetype 4.0.0

How to fix:

Add the ci-reviewed label after verifying the version changes are expected.


⚠️ Warnings

OSV vulnerability scan · View job

64 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

@alt-glitch alt-glitch added type/perf Performance improvement or optimization area/config Config system, migrations, profiles P3 Low — cosmetic, nice to have labels Aug 8, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Related: #81736 improves the existing local-search index, while this PR replaces that path with Algolia DocSearch. These are competing docs-search approaches for maintainer choice.

@teknium1
teknium1 merged commit 60942fc into main Aug 8, 2026
25 checks passed
@teknium1
teknium1 deleted the feat/docs-algolia-docsearch branch August 8, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles P3 Low — cosmetic, nice to have type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants