You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cap score set search and remove its per-result queries #885
search_score_sets (routers/score_sets.py:699) caps results at SCORE_SET_SEARCH_MAX_LIMIT only when publication_identifiers is absent. A search with publication identifiers has no cap, and search_my_score_sets (:812) has none either.
The search routes build the full score set view model for each result and then trim it to the short one, which triggers about 15 lazy-load queries per result.
get_filter_options_for_search (:753, through fetch_score_set_search_filter_options in lib/score_sets.py) loads every matching score set plus 8–15 queries each. The ui calls it after every pause in typing, and the handler keeps running after the ui cancels.
Scope
Apply the cap to every search, including publication-identifier searches and /me/score-sets/search.
Build the short view model directly, with loader options for the fields it serializes.
Compute filter options with aggregate queries over the matching set, not by loading score sets.
Acceptance criteria
No search route returns more than SCORE_SET_SEARCH_MAX_LIMIT results.
Query-count tests assert a constant number of queries for search and for filter options as the number of matches grows.
Search and filter-option responses are unchanged for the existing tests.
Activity