formatting and logic change to resolve_relations, remove fuzzy search

This commit is contained in:
phernandez
2025-11-25 22:54:37 -06:00
parent 138c283d6c
commit 9b7bbc7116
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -350,7 +350,10 @@ async def run_migrations(
# For SQLite: Create FTS5 virtual table
# For Postgres: No-op (tsvector column added by migrations)
# The project_id is not used for init_search_index, so we pass a dummy value
if database_type == DatabaseType.POSTGRES or app_config.database_backend == DatabaseBackend.POSTGRES:
if (
database_type == DatabaseType.POSTGRES
or app_config.database_backend == DatabaseBackend.POSTGRES
):
await PostgresSearchRepository(session_maker, 1).init_search_index()
else:
await SQLiteSearchRepository(session_maker, 1).init_search_index()
+4 -1
View File
@@ -448,8 +448,11 @@ class EntityService(BaseService[EntityModel]):
import asyncio
# Create tasks for all relation lookups
# Use strict=True to disable fuzzy search - only exact matches should create resolved relations
# This ensures forward references (links to non-existent entities) remain unresolved (to_id=NULL)
lookup_tasks = [
self.link_resolver.resolve_link(rel.target) for rel in markdown.relations
self.link_resolver.resolve_link(rel.target, strict=True)
for rel in markdown.relations
]
# Execute all lookups in parallel