Skip to content

Add local search plugin#561

Open
mcclowes wants to merge 3 commits intomainfrom
claude/implement-feature-Hux6N
Open

Add local search plugin#561
mcclowes wants to merge 3 commits intomainfrom
claude/implement-feature-Hux6N

Conversation

@mcclowes
Copy link
Copy Markdown
Owner

Adds @easyops-cn/docusaurus-search-local theme to enable offline search across docs, blog posts, and pages. Configured with:

  • Hashed index for long-term caching
  • English language support
  • Search term highlighting on target pages
  • Keyboard shortcut hint in search bar

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mcclowes-com Ready Ready Preview, Comment Mar 25, 2026 4:54pm

Request Review

@github-actions
Copy link
Copy Markdown

🤖 Claude PR Summary

Pull Request Summary

Overview

This PR adds local search functionality to a Docusaurus documentation site by integrating the @easyops-cn/docusaurus-search-local plugin.

Key Changes

1. Main Configuration (docusaurus.config.js)

  • Added @easyops-cn/docusaurus-search-local theme with comprehensive configuration:
    • Enables search for docs, blog, and pages
    • Configures search highlighting and result limits (8 results)
    • Sets up keyboard shortcuts and hash-based URLs
    • Supports English language indexing
    • Includes Chinese text segmentation support via Jieba

2. Dependencies (package.json & package-lock.json)

  • Main dependency: @easyops-cn/docusaurus-search-local@^0.52.2
  • Key sub-dependencies added:
    • @node-rs/jieba - Chinese text segmentation (with platform-specific binaries)
    • lunr - Full-text search library
    • mark.js - Text highlighting
    • cheerio - HTML parsing
    • comlink - Web Workers support

Notable Patterns & Considerations

Positives:

  • Comprehensive search configuration with sensible defaults
  • Proper use of optional dependencies for platform-specific binaries
  • Adds offline/local search capability (no external service needed)

⚠️ Potential Concerns:

  1. Bundle Size: Adds significant dependencies (~150+ packages in lock file), including platform-specific native modules
  2. Build Performance: Chinese language support (@node-rs/jieba) includes native binaries for multiple platforms, which may impact build times
  3. Deprecation Warning: whatwg-encoding@3.1.1 shows deprecation notice (though from transitive dependency)
  4. Language Configuration: Only English is configured (language: ['en']), but Jieba (Chinese) support is included - consider if Chinese search is needed

💡 Recommendations:

  • Test build times and final bundle size impact
  • Verify if Chinese language support is required; if not, this might be unnecessary overhead
  • Consider documenting the search feature in user documentation

Generated by Claude

@github-actions
Copy link
Copy Markdown

🤖 Claude PR Summary

Pull Request Summary

Overview

This PR adds local search functionality to a Docusaurus documentation site using the @easyops-cn/docusaurus-search-local plugin.

Key Changes

1. Main Configuration (docusaurus.config.js)

  • Added the @easyops-cn/docusaurus-search-local theme plugin with comprehensive configuration
  • Search is enabled for:
    • ✅ Documentation pages (indexDocs: true)
    • ✅ Blog posts (indexBlog: true)
    • ❌ Other pages (indexPages: false)
  • Notable features configured:
    • Search result limit: 8 items
    • Search term highlighting on target pages
    • Keyboard shortcut hints enabled
    • Glossary-specific exclusions: ignoring /glossary/ files and CSS selectors (.glossary-tooltip, [data-glossary-term])

2. Dependencies (package.json, package-lock.json)

  • Added @easyops-cn/docusaurus-search-local v0.52.2
  • Brings in several transitive dependencies:
    • lunr & lunr-languages (search engine)
    • @node-rs/jieba (Chinese text segmentation with platform-specific binaries)
    • cheerio v1.1.2 (HTML parsing)
    • mark.js (text highlighting)
    • Multiple optional native bindings for different platforms

Patterns & Observations

Positive:

  • Well-configured glossary exclusions suggest intentional prevention of duplicate/noisy search results
  • Comprehensive platform support through optional dependencies (won't break on unsupported platforms)

⚠️ Considerations:

  • Large dependency footprint (~150+ new packages in lock file)
  • Multiple platform-specific native bindings added (Android, Darwin, Linux, Windows, FreeBSD, WASM)
  • The plugin appears designed for Chinese language support (@node-rs/jieba), though only English is configured
  • Consider verifying build times haven't increased significantly due to the dependency size

Recommendation

Review that glossary exclusion patterns correctly match your file structure and ensure the search index size remains reasonable for your documentation scale.


Generated by Claude

claude and others added 3 commits March 25, 2026 16:19
Adds @easyops-cn/docusaurus-search-local theme to enable offline
search across docs, blog posts, and pages. Configured with:
- Hashed index for long-term caching
- English language support
- Search term highlighting on target pages
- Keyboard shortcut hint in search bar
- Disable page indexing to reduce duplicates
- Ignore glossary routes from search index
- Ignore glossary tooltip CSS selectors during indexing
- Enable explicit search result paths for clearer navigation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mcclowes mcclowes changed the title Implement this feature Add local search plugin Mar 25, 2026
@mcclowes mcclowes force-pushed the claude/implement-feature-Hux6N branch from fe36517 to 0e351a0 Compare March 25, 2026 16:21
@github-actions
Copy link
Copy Markdown

🤖 Claude PR Summary

Pull Request Analysis

Overview

This PR adds local search functionality to a Docusaurus documentation site by integrating the @easyops-cn/docusaurus-search-local plugin.

Key Changes

1. Main Configuration (docusaurus.config.js)

  • Adds the @easyops-cn/docusaurus-search-local theme to the themes array
  • Configures comprehensive search settings:
    • Enables indexing for docs and blog content (but excludes pages)
    • Sets search result limit to 8 items
    • Enables search term highlighting on target pages
    • Notable: Explicitly ignores glossary pages and glossary tooltip elements to prevent duplicate search results

2. Dependencies (package.json & package-lock.json)

  • Adds @easyops-cn/docusaurus-search-local v0.52.2 as a dependency
  • Brings in multiple transitive dependencies including:
    • @node-rs/jieba (Chinese text segmentation library with platform-specific binaries)
    • lunr and lunr-languages (search indexing libraries)
    • mark.js (text highlighting)
    • Various supporting packages for HTML parsing (cheerio) and web workers (comlink)

Notable Patterns & Observations

✅ Positive

  • Well-configured search options with thoughtful exclusions for glossary content
  • Uses hashed filenames for cache busting (hashed: true)
  • Includes keyboard shortcut hints for better UX
  • Language explicitly set to English only

⚠️ Considerations

  • Large dependency footprint: The search plugin adds ~140+ new dependencies, including platform-specific native binaries for multiple OS/architecture combinations
  • Native dependencies: @node-rs/jieba includes optional native addons for various platforms (may increase build complexity)
  • Minor version downgrades: Some transitive dependencies show version downgrades (e.g., dompurify 3.3.3 → 3.3.0, fs-extra 11.3.3 → 11.3.4, immutable 5.1.5 → 5.1.4)
  • Deprecated dependency: whatwg-encoding@3.1.1 is marked as deprecated in the lock file

🔍 Review Focus Areas

  1. Verify the glossary exclusion patterns work as intended
  2. Test search functionality across different content types
  3. Monitor bundle size impact on site performance
  4. Consider if Chinese language support (via jieba) is needed, or if this can be excluded to reduce dependencies

Generated by Claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants