File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -60,14 +60,20 @@ def process_topics(self, search_term: str):
6060 FROM repos r
6161 JOIN repo_topics t ON r.nameWithOwner = t.repo
6262 WHERE LOWER(t.topics) LIKE '%' || ? || '%'
63+ ),
64+ split_topics AS (
65+ SELECT
66+ fr.nameWithOwner,
67+ unnest(string_split(t.topics, '|')) as topic
68+ FROM filtered_repos fr
69+ JOIN repo_topics t ON fr.nameWithOwner = t.repo
6370 )
6471 SELECT
65- unnest(string_split(t.topics, '|')) as topic,
72+ topic,
6673 COUNT(*) as count
67- FROM filtered_repos fr
68- JOIN repo_topics t ON fr.nameWithOwner = t.repo
69- WHERE LOWER(unnest(string_split(t.topics, '|'))) != ?
70- GROUP BY unnest(string_split(t.topics, '|'))
74+ FROM split_topics
75+ WHERE LOWER(topic) != ?
76+ GROUP BY topic
7177 HAVING COUNT(*) > 2
7278 ORDER BY count DESC
7379 """
You can’t perform that action at this time.
0 commit comments