From 443088f6093d3420212be0e1af3b9e802dca9362 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 6 Aug 2024 22:03:31 +0300 Subject: Add support for advanced package search --- mod/mod-package-details.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mod/mod-package-details.cxx') diff --git a/mod/mod-package-details.cxx b/mod/mod-package-details.cxx index 15a4115..ceb23c5 100644 --- a/mod/mod-package-details.cxx +++ b/mod/mod-package-details.cxx @@ -119,7 +119,7 @@ handle (request& rq, response& rs) throw invalid_request (400, "invalid package name format"); } - const package_name& name (pkg->name); + const package_name& name (pkg->name); const string ename (mime_url_encode (name.string (), false)); auto url = [&ename] (bool f = false, @@ -226,8 +226,8 @@ handle (request& rq, response& rs) } size_t pkg_count ( - package_db_->query_value ( - search_params (squery, tenant, name))); + package_db_->query_value ( + search_params (squery, tenant, name))); // Let's disable autofocus in the full page mode since clicking the full or // more link the user most likely intends to read rather than search, while @@ -244,8 +244,8 @@ handle (request& rq, response& rs) search_params (squery, tenant, name) + "ORDER BY rank DESC, version_epoch DESC, " "version_canonical_upstream DESC, version_canonical_release DESC, " - "version_revision DESC" + - "OFFSET" + to_string (page * res_page) + + "version_revision DESC" + + "OFFSET" + to_string (page * res_page) + "LIMIT" + to_string (res_page))) { shared_ptr p (package_db_->load (pr.id)); -- cgit v1.1