This commit is contained in:
ondal 2025-06-17 13:14:02 +09:00
parent 66f3df24bf
commit 59e02fd0cd

View File

@ -1197,7 +1197,7 @@ class VectorService:
def get_store_by_id(self, store_id: str) -> Optional[Dict[str, Any]]:
"""
store_id로 특정 매장 정보를 조회합니다.
store_id로 매장 정보를 조회합니다.
Args:
store_id: 조회할 매장 ID
@ -1213,9 +1213,10 @@ class VectorService:
logger.info(f"🔍 매장 정보 조회 시작: store_id={store_id}")
# Vector DB에서 해당 store_id로 검색
# ✅ 수정: include에서 'ids' 제거 (ChromaDB는 자동으로 ids를 반환함)
results = self.collection.get(
where={"store_id": store_id},
include=['documents', 'metadatas', 'ids']
include=['documents', 'metadatas'] # 'ids' 제거
)
if not results or not results.get('metadatas') or not results['metadatas']:
@ -1225,6 +1226,7 @@ class VectorService:
# 첫 번째 결과 사용 (store_id는 유니크해야 함)
metadata = results['metadatas'][0]
document = results['documents'][0] if results.get('documents') else None
# ✅ 수정: ChromaDB는 자동으로 ids를 반환하므로 그대로 사용
document_id = results['ids'][0] if results.get('ids') else None
logger.info(f"✅ 매장 정보 조회 성공: {metadata.get('store_name', 'Unknown')}")