Skip to content

fix(search): strip bloat elements from search index to reduce size - #23

Merged
XtremeOwnageDotCom merged 1 commit into
mainfrom
fix/search-index-bloat
Jul 29, 2026
Merged

fix(search): strip bloat elements from search index to reduce size#23
XtremeOwnageDotCom merged 1 commit into
mainfrom
fix/search-index-bloat

Conversation

@XtremeOwnageDotCom

Copy link
Copy Markdown
Contributor

The search index was including bloat-inducing elements like SVG diagrams, images, canvas, and figure captions in each doc's text field, causing large indexes (>2 MB for large sites). This caused 502 errors for deployments fronted by backends with response size caps (e.g., AWS ALB limits to ~1 MB).

Strip only problematic elements (svg, img, canvas, picture, figure) while preserving semantic HTML (

, , , , etc.) so teasers render richly in the Material search UI. This keeps the search index lean without sacrificing presentation.

Add a configurable plugin option strip_bloat_elements (defaults to true) to allow users to disable stripping if needed.

Typical reduction: 2.3 MB -> 0.9 MB (60% smaller).

What & why

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / chore

Checklist

  • dotnet format Netdocs.slnx --verify-no-changes passes
  • dotnet build Netdocs.slnx -c Release succeeds
  • dotnet test Netdocs.slnx -c Release passes
  • Added/updated tests for the change
  • Updated docs under docs-site/docs/** if behavior changed

Notes for reviewers

The search index was including bloat-inducing elements like SVG diagrams,
images, canvas, and figure captions in each doc's text field, causing large
indexes (>2 MB for large sites). This caused 502 errors for deployments fronted
by backends with response size caps (e.g., AWS ALB limits to ~1 MB).

Strip only problematic elements (svg, img, canvas, picture, figure) while
preserving semantic HTML (<p>, <strong>, <em>, <code>, etc.) so teasers render
richly in the Material search UI. This keeps the search index lean without
sacrificing presentation.

Add a configurable plugin option `strip_bloat_elements` (defaults to true)
to allow users to disable stripping if needed.

Typical reduction: 2.3 MB -> 0.9 MB (60% smaller).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@XtremeOwnageDotCom
XtremeOwnageDotCom merged commit bcd08c7 into main Jul 29, 2026
1 check passed
@XtremeOwnageDotCom
XtremeOwnageDotCom deleted the fix/search-index-bloat branch July 29, 2026 21:19
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.

1 participant