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 --- libbrep/package.hxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libbrep') diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 668dc5c..e2d2da5 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -983,6 +983,20 @@ namespace brep search_text (const weighted_text&) {} }; + // Packages count. + // + #pragma db view object(package) + struct package_count + { + size_t result; + + operator size_t () const {return result;} + + // Database mapping. + // + #pragma db member(result) column("count(" + package::id.tenant + ")") + }; + // Package search query matching rank. // #pragma db view query("/*CALL*/ SELECT * FROM search_latest_packages(?)") @@ -1009,7 +1023,7 @@ namespace brep }; #pragma db view query("/*CALL*/ SELECT count(*) FROM search_packages(?)") - struct package_count + struct package_search_count { size_t result; -- cgit v1.1