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.
This commit is contained in:
parent
61b64fae25
commit
323b7004ed
6 changed files with 69 additions and 24 deletions
|
|
@ -381,6 +381,10 @@ GEM
|
|||
activesupport (= 8.1.3)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 8.1.3)
|
||||
rails-controller-testing (1.0.5)
|
||||
actionpack (>= 5.0.1.rc1)
|
||||
actionview (>= 5.0.1.rc1)
|
||||
activesupport (>= 5.0.1.rc1)
|
||||
rails-dom-testing (2.3.0)
|
||||
activesupport (>= 5.0.0)
|
||||
minitest
|
||||
|
|
@ -592,6 +596,7 @@ DEPENDENCIES
|
|||
propshaft
|
||||
puma (>= 5.0)
|
||||
rails (~> 8.1.0)
|
||||
rails-controller-testing
|
||||
rails-erd
|
||||
rails-healthcheck
|
||||
rails_icons (~> 1.3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue