We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d5d636 commit bdd026dCopy full SHA for bdd026d
1 file changed
backend/app/services/topic_service.py
@@ -60,14 +60,20 @@ def process_topics(self, search_term: str):
60
FROM repos r
61
JOIN repo_topics t ON r.nameWithOwner = t.repo
62
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
70
)
71
SELECT
- unnest(string_split(t.topics, '|')) as topic,
72
+ topic,
73
COUNT(*) as count
- FROM filtered_repos fr
- JOIN repo_topics t ON fr.nameWithOwner = t.repo
- WHERE LOWER(unnest(string_split(t.topics, '|'))) != ?
- GROUP BY unnest(string_split(t.topics, '|'))
74
+ FROM split_topics
75
+ WHERE LOWER(topic) != ?
76
+ GROUP BY topic
77
HAVING COUNT(*) > 2
78
ORDER BY count DESC
79
"""
0 commit comments