Commit graph

10 commits

Author SHA1 Message Date
4c736096ae Show search source badges only with show_sources param
The badges are a debugging aid - render them only when explicitly
requested via ?show_sources=1 instead of on every search.
2026-08-23 10:49:32 +02:00
323b7004ed Expose which search strategy produced each result
query_packages now assigns @search_sources - a hash mapping package
ids to the matching strategy that put them into the results: :exact,
:name_prefix, :name_contains, :semantic or :fulltext. The grid and
list views render a small badge with a humanized label per result,
making the search tiers observable. semantic_results() was folded
into search_packages() so each branch tags its own source. Adds the
rails-controller-testing gem for assigns() in tests.
2026-08-23 10:39:50 +02:00
4948fe50e3 Add semantic package search via pgvector embeddings
Package text search now combines several strategies: exact name match,
name prefix promotion, compound word splitting ("sqlite browser" finds
"sqlitebrowser") and semantic nearest neighbor search over description
embeddings computed by an external embedding service (all-MiniLM-L6-v2,
384 dims) stored with the pgvector extension. Classic PostgreSQL
full-text search remains as fallback when the vector service is
unreachable. Gibberish queries without lexical overlap with the package
data return empty results instead of random matches.

Embeddings can be backfilled with bin/rails debshots:compute_vectors.

Also drops the unused lograge gem from the Gemfile.
2026-08-22 22:07:56 +02:00
2b24083653 SQL optimisation rolled back. It lead to access problems. 2021-03-01 02:07:55 +01:00
b36a49a6cd Avoid N+1 SQL queries with CanCanCan accessibility checks 2021-03-01 00:49:25 +01:00
eee196507b Forgot to run tests 2021-02-28 22:07:33 +01:00
5889f70a4d Don't show anything in list view if there is no long description 2021-02-21 16:43:57 +01:00
940b3a16fa Slightly less ugly list view 2021-02-21 15:57:42 +01:00
1f7ba785a1 One partial view eliminated 2021-02-14 15:33:22 +01:00
c636ee40a5 Simplified browsing view 2021-02-14 11:14:13 +01:00