-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: better filtering of test search queries for more accurate data (…
…#3752) * chore: better filtering of test search queries for more accurate data * chore: upgrade supabase cli client * chore: db types * chore: db types with updated supabase
- Loading branch information
Showing
8 changed files
with
146 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/backend/supabase/migrations/20240201004610_top_searches_filtering.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
set check_function_bodies = off; | ||
|
||
CREATE OR REPLACE FUNCTION public.match_weekly_search_usage() | ||
RETURNS TABLE(query_string character varying, count bigint) | ||
LANGUAGE plpgsql | ||
AS $function$ | ||
begin | ||
return query | ||
SELECT | ||
queries.query_string, | ||
count(*) as count | ||
FROM | ||
queries | ||
WHERE | ||
type = 'docs-search' | ||
AND queries.query_string != 'dsys' | ||
AND queries.query_string != 'this is a search test' | ||
AND queries.created_at >= now() - interval '1 week' | ||
GROUP BY | ||
queries.query_string | ||
ORDER BY | ||
count DESC | ||
LIMIT 20; | ||
end; | ||
$function$ | ||
; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.