태그 그룹의 슬러그를 사용하여 카테고리 수정자를 적용하면 _태그 그룹_을 검색할 수 있습니다. 예를 들어 'topic status’라는 이름의 태그 그룹이 있다면 #topic-status를 사용하여 해당 태그를 검색할 수 있습니다. 그러나 이 방식으로는 태그를 제외할 수 없으므로 -#topic-status는 작동하지 않습니다.
Data Explorer 쿼리를 사용하여 특정 태그가 하나만 있는 주제 목록을 가져올 수 있습니다. 다음과 같은 쿼리가 도움이 될 수 있습니다:
--[params]
-- string :tag_name
with tagged_topics AS (
SELECT
topic_id
FROM topic_tags
JOIN tags
ON tags.id = topic_tags.tag_id
WHERE tags.name = :tag_name
),
counts AS (
SELECT
COUNT(id) AS tag_count,
tagged_topics.topic_id
FROM topic_tags
JOIN tagged_topics
ON tagged_topics.topic_id = topic_tags.topic_id
GROUP BY tagged_topics.topic_id
)
SELECT
c.topic_id
FROM counts c
JOIN topics t
ON t.id = c.topic_id
WHERE t.deleted_at IS NULL
AND t.archetype = 'regular'
AND c.tag_count = 1