fix: 뉴스 분야 필터 — file_path 폴더명 기반 매칭

경향신문/문화 → file_path LIKE 'news/경향신문 문화/%'

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-06 15:27:01 +09:00
parent 8bb2ea4f29
commit e10b0f2883

View File

@@ -118,8 +118,10 @@ async def list_articles(
)
if source:
if '/' in source:
# 신문사/분야 형태 → ai_tags로 필터
query = query.where(Document.ai_tags.cast(String).contains(source))
# 신문사/분야 형태 → file_path에서 폴더명 매칭
# source = "경향신문/문화" → file_path LIKE 'news/경향신문 문화/%'
folder = source.replace('/', ' ')
query = query.where(Document.file_path.like(f"news/{folder}/%"))
else:
# 신문사만 → ai_sub_group
query = query.where(Document.ai_sub_group == source)