debug: more logs in indexing
All checks were successful
Deploy on push / deploy (push) Successful in 53s
All checks were successful
Deploy on push / deploy (push) Successful in 53s
This commit is contained in:
parent
385057ffcd
commit
57e1e8e6bd
|
@ -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}")
|
||||
|
|
Loading…
Reference in New Issue
Block a user