From e10b0f28837e314335406e9bae0abd37486537f3 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Mon, 6 Apr 2026 15:27:01 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=89=B4=EC=8A=A4=20=EB=B6=84=EC=95=BC?= =?UTF-8?q?=20=ED=95=84=ED=84=B0=20=E2=80=94=20file=5Fpath=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=EB=AA=85=20=EA=B8=B0=EB=B0=98=20=EB=A7=A4=EC=B9=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 경향신문/문화 → file_path LIKE 'news/경향신문 문화/%' Co-Authored-By: Claude Opus 4.6 (1M context) --- app/api/news.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/news.py b/app/api/news.py index 119779d..e2eca2a 100644 --- a/app/api/news.py +++ b/app/api/news.py @@ -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)