feat(doc-symbols): popularity column + popularity-aware resolver #66

Merged
raisondetredev merged 1 commit from refs/pull/66/head into main 2026-06-25 22:23:15 +02:00
raisondetredev commented 2026-06-25 21:59:47 +02:00 (Migrated from codeberg.org)

Popularity + CRAN spans three PRs — backend project-halkyon/halkyon-infra#66, curator project-halkyon/halkyon-curator#18 (this/extended), app project-halkyon/halkyon-learn#687. Apply the infra migration, re-seed, then ship the app.

Backend for popularity-aware doc resolution.

  • popularity BIGINT column on doc_symbols (download/usage weight; high baseline for std/SDK symbols), set by the curator seed.
  • Rewrites resolve_doc_symbol with two changes:
    1. New match: the stored fqn is a prefix of the query — so a typed descripti finds the real, shorter package descr (the old resolver only matched when the query was a substring of search_blob, which never caught this).
    2. Ranks exact → popularity(desc) → match-quality → shorter fqn → name. The exact-named symbol is always returned (the app badges it); the most popular near-matches lead.

RETURNS SETOF doc_symbols, so popularity rides along and the app re-derives exactness. The fqn-prefix test is per-row (no trigram index) — fine for this interactive, low-frequency lookup over a read-only table.

Apply before re-seeding (the seed now writes popularity).

> **Popularity + CRAN** spans three PRs — backend project-halkyon/halkyon-infra#66, curator project-halkyon/halkyon-curator#18 (this/extended), app project-halkyon/halkyon-learn#687. Apply the infra migration, re-seed, then ship the app. Backend for popularity-aware doc resolution. - **`popularity BIGINT`** column on `doc_symbols` (download/usage weight; high baseline for std/SDK symbols), set by the curator seed. - **Rewrites `resolve_doc_symbol`** with two changes: 1. New match: the stored fqn is a **prefix of the query** — so a typed `descripti` finds the real, shorter package `descr` (the old resolver only matched when the query was a *substring* of `search_blob`, which never caught this). 2. Ranks `exact → popularity(desc) → match-quality → shorter fqn → name`. The exact-named symbol is always returned (the app badges it); the most popular near-matches lead. `RETURNS SETOF doc_symbols`, so `popularity` rides along and the app re-derives exactness. The fqn-prefix test is per-row (no trigram index) — fine for this interactive, low-frequency lookup over a read-only table. **Apply before re-seeding** (the seed now writes `popularity`).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
project-halkyon/halkyon-infra!66
No description provided.