Skip to content

feat: search improvements — pagination, heading scroll, and body text indexing #129

Open

Description

@rohilsurana

Problem

Several search limitations affect usability:

  1. Hardcoded LIMIT 20 — no pagination or cursor support for large result sets
  2. Heading matches don't scroll — clicking a heading result navigates to the page but doesn't scroll to the `#anchor`
  3. Static index only indexes headings — `build-search-index.ts` extracts headings but not prose body text, making full-text search incomplete (the runtime FTS index in `search.ts` does index body text, but the two are inconsistent)
  4. BM25 weights are undocumented magic numbers — `bm25(search_fts, 10.0, 5.0, 1.0)` with no explanation of tuning rationale

Suggested Improvements

  • Add `offset`/`limit` query params to the search API
  • After navigating to a heading result, scroll the anchor into view on the client
  • Unify the two search indexing paths (static builder vs runtime builder)
  • Document or make configurable the BM25 weight tuning

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions