refactor(search): remove NLP/smart-search feature entirely #772

Merged
marcel merged 51 commits from worktree-feat+nlp-service into main 2026-06-08 10:57:01 +02:00
Showing only changes of commit 8d4f30019b - Show all commits

View File

@@ -1,11 +1,14 @@
"""FastAPI app — /parse and /health endpoints."""
from __future__ import annotations
import logging
import os
from contextlib import asynccontextmanager
from fastapi import FastAPI, HTTPException
logger = logging.getLogger(__name__)
from extractor import extract, get_person_matcher, set_person_matcher
from models import ParseRequest, ParseResponse
from person_matcher import PersonMatcher
@@ -30,8 +33,14 @@ async def lifespan(app: FastAPI):
m = PersonMatcher()
db_url = os.environ.get("DATABASE_URL")
if db_url:
rows = _load_persons_from_db(db_url)
m.load(rows)
try:
rows = _load_persons_from_db(db_url)
m.load(rows)
logger.info("PersonMatcher loaded %d name variants from DB", len(m))
except Exception:
logger.error("Failed to load persons from DB — person matching disabled", exc_info=True)
else:
logger.warning("DATABASE_URL not set — person matching disabled")
set_person_matcher(m)
yield