feat(vector): server-side kinds filter for search_similar (legacy fallback) + graceful solved-search degrade

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 14:23:28 +02:00
co-authored by Claude Fable 5
parent 8d427a2ccb
commit a26f16ad79
7 changed files with 340 additions and 23 deletions
+4 -3
View File
@@ -45,10 +45,11 @@ class RestSearcher:
) -> list[VectorHit]:
hits: list[VectorHit] = []
for table in tables_for_kinds(kinds):
for row in self.client.search_similar(table, query_vec, top_n):
for row in self.client.search_similar(table, query_vec, top_n, kinds=kinds):
hits.append(hit_from_metadata(row.get("similarity", 0.0), row.get("metadata")))
# schema_records contiene sia schema_table sia schema_column: la RPC non filtra
# per kind, quindi lo facciamo lato client per parita' col path diretto (#25).
# Il filtro per kind avviene server-side (RPC con `kinds`); il post-filter resta
# come difesa per il fallback legacy (server pre-migrazione: 404 -> query senza
# filtro) e per parita' col path diretto (#25).
if kinds:
allowed = set(kinds)
hits = [h for h in hits if h.kind in allowed]