Skip to content

Search: replace DOM-based search with pre-computed search index #4508

@Syknapse

Description

@Syknapse

Blocked by

Issue "Refactor archive system: manifest + lazy loading + pre-computed contribution count" — implement only after that is stable.

Note

Future improvement. The lazy-loading refactor (above) solves full-archive search by fetching all files on search focus. This issue goes further: a pre-computed index makes search instant without downloading all archive JSON.

Problem

Even after the lazy-loading refactor, searching still means downloading all archive JSON (~10–13 MB, growing linearly). On slow mobile this is a poor experience.

Fix

At archive time, generate search-index.json alongside manifest.json:

[
  { "name": "Jane Doe", "about": "...", "handles": ["@jane"], "resources": ["title1", "title2"], "file": "archive_12.json" },
  ...
]

~200–400 KB for 4,500 cards — smaller than two archive files. Load eagerly on page open. Search runs against the index instantly. When a match points to an un-loaded archive file, fetch that specific file on demand to render the card.

Files

  • scripts/card-to-archive.js — updated to also generate search-index.json
  • archive/search-index.json — new (auto-generated)
  • assets/script.js — updated: load index eagerly, search against index, fetch specific archive files on match

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions