import chromadb
from chromadb.config import Settings

# Chroma 서버 연결 (기존과 동일)
client = chromadb.HttpClient(
    host="localhost",
    port=8000,
    settings=Settings(chroma_api_impl="rest")
)

# 컬렉션 가져오기
collection = client.get_collection("excel_honbun")

# 전체 등록된 id 리스트 가져오기
data = collection.get()

print("등록된 총 문서 수:", len(data['ids']))

# 예시로 일부 출력
for id, doc in zip(data['ids'], data['documents']):
    print(f"ID: {id}")
    print(f"내용 샘플: {doc[:100]}...")  # 본문 일부만 출력
    break