Skip to content

Docs search: find flags and codes, rank the changelog last, show passages #581

Closed

Description

@aicayzer

Summary

Make the docs search find flags and codes, stop the changelog crowding out the guides, and show the matching passage instead of a heading.

Context

At docs commit aeb5162:

  • print-token returns no hits, though /cli names marfa login --print-token.
  • soft delete trash returns /changelog first. The changelog is 11,854 words, the largest page; the next is 5,093.
  • The first snippet of a hit is often the heading and not the passage. For rotate a key the first snippet is the text "Rotate a key".

All four search surfaces call src/lib/docs-tools.ts, so one change covers them.

Acceptance criteria

  • A query for a flag (print-token), a snake_case code or a dotted name finds the page that contains it.
  • The changelog ranks after any other page that matches equally.
  • The first snippet of a hit is passage text, not a heading alone.
  • Every query in the test from the pinned-queries sub-issue still passes.
  • The JSON shapes of /api/docs/search and the MCP docs_search result are unchanged, and src/lib/mcp/server.test.ts passes.

Out of scope

  • Embeddings or a second search system.

Notes

I did not check whether Orama's tokenizer can be configured through createFromSource in Fumadocs. If it cannot, say what is needed (a custom tokenizer, a pre-processing step, or a different Orama setup) before building.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions