Spaces:
Running
Running
| """Quick script to check what's stored in ChromaDB metadata collection.""" | |
| from services.chroma_service import ChromaService | |
| def check_metadata(): | |
| print("Connecting to ChromaDB...") | |
| c = ChromaService() | |
| data = c.metadata_collection.get() | |
| total = len(data['ids']) | |
| print(f"Total entries in document_metadata: {total}") | |
| if total > 0: | |
| print("\n--- Sample entry (first) ---") | |
| meta = data['metadatas'][0] | |
| for key, value in sorted(meta.items()): | |
| print(f" {key}: {value}") | |
| # Find Feb 2026 renewals | |
| print("\n--- Entries with Feb 2026 renewal ---") | |
| feb_count = 0 | |
| for meta in data['metadatas']: | |
| rd = str(meta.get('renewal_date', '')) | |
| ry = meta.get('renewal_year', 0) | |
| # Check for Feb 2026 | |
| if ry == 2026 and '-02-' in rd: | |
| feb_count += 1 | |
| print(f" {meta.get('document_title')}: renewal_date={rd}, renewal_year={ry}") | |
| print(f"\nTotal Feb 2026 renewals found: {feb_count}") | |
| # Show all unique renewal years | |
| years = set(meta.get('renewal_year', 0) for meta in data['metadatas']) | |
| print(f"\nAll renewal years in data: {sorted(years)}") | |
| else: | |
| print("No data found!") | |
| if __name__ == "__main__": | |
| check_metadata() | |