feat(search): relevance ranking + websearch_to_tsquery #13
Reference in New Issue
Block a user
Delete Branch "feature/search-relevance-ranking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First slice of the search-core epic (docs/discovery/05).
Verified ranking SQL semantics directly against a live Postgres instance (not just docs). New regression test locks the date-order fallback path. All 40 tests pass; Release build clean.
🤖 Generated with Claude Code
Slice 1 of search-core (docs/discovery/05, MVP): replace date-only ordering with ts_rank_cd relevance ranking (Npgsql RankCoverDensity) when a free-text query is present, recency as a tiebreaker; browse-only requests (no query) keep today's date-descending order unchanged. Upgrade plainto_tsquery -> websearch_to_tsquery so quotes ("exact phrase"), OR, and -exclusions work as users already expect from web search boxes. Verified: ranking SQL semantics (plain/phrase/exclusion/ts_rank_cd score) checked directly against a live Postgres instance, not just Npgsql's docs. Added a regression test locking the date-order fallback path (the one behaviour testable without a live Postgres, matching this repo's existing no-Testcontainers convention -- see AuthEndpointsTests.TestAppFactory). All 40 tests pass; full Release build clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>