feat(ingest): recompute searchable on ingest + metadata completion (GAP-13, FU-2a)

Wire db.recompute_searchable into the ingest pipeline (after statuses are set) and into
extract_and_apply (after fields are persisted to DB, success path only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 20:47:51 +00:00
parent 4b8bbc3794
commit 6dbcb7e798
2 changed files with 3 additions and 0 deletions

View File

@@ -197,6 +197,7 @@ async def ingest_document(
await db.set_case_law_halacha_status(case_law_id, "pending")
await db.request_metadata_extraction(case_law_id)
await db.request_halacha_extraction(case_law_id)
await db.recompute_searchable(case_law_id)
await progress("completed", 100,
f"נקלט: {stored_chunks} chunks. חילוץ הלכות ומטא-דאטה ממתינים בתור.")

View File

@@ -368,6 +368,8 @@ async def extract_and_apply(
if not suggested:
return {"status": "no_metadata", "fields": []}
result = await apply_to_record(case_law_id, suggested, overwrite_case_number=overwrite_case_number)
if result["updated"]:
await db.recompute_searchable(case_law_id)
return {
"status": "completed" if result["updated"] else "no_changes",
"fields": result["fields"],