debug: more logs in indexing
All checks were successful
Deploy on push / deploy (push) Successful in 53s

This commit is contained in:
Stepan Vladovskiy 2025-03-21 14:10:09 -03:00
parent 385057ffcd
commit 57e1e8e6bd

View File

@ -161,6 +161,19 @@ class SearchService:
"/bulk-index",
json={"documents": documents}
)
# Error Handling
if response.status_code == 422:
error_detail = response.json()
logger.error(f"Validation error from search service: {error_detail}")
# Try to identify problematic documents
for doc in documents:
if len(doc['text']) > 10000: # Adjust threshold as needed
logger.warning(f"Document {doc['id']} has very long text: {len(doc['text'])} chars")
# Continue with next batch instead of failing completely
continue
response.raise_for_status()
result = response.json()
logger.info(f"Batch {i//batch_size + 1} indexed successfully: {result}")