Fix semantic search: query chunks instead of empty parent_chunks table

This commit is contained in:
Accusys
2026-05-08 01:29:10 +08:00
parent 3e70f1b590
commit d8714aa46e
+6 -6
View File
@@ -4622,13 +4622,13 @@ impl PostgresDb {
let results = sqlx::query_as::<_, SemanticSearchResult>( let results = sqlx::query_as::<_, SemanticSearchResult>(
r#" r#"
SELECT SELECT
id, scene_order, start_time, end_time, id, chunk_index as scene_order, start_time, end_time,
summary_text as summary, COALESCE(summary_text, text_content, '') as summary,
metadata, metadata,
(1 - (summary_vector <=> $1::vector)) as similarity (1 - (embedding <=> $1::vector)) as similarity
FROM parent_chunks FROM dev.chunks
WHERE uuid = $2 WHERE file_uuid = $2 AND chunk_type = 'cut' AND embedding IS NOT NULL
ORDER BY summary_vector <=> $1::vector ORDER BY embedding <=> $1::vector
LIMIT $3 LIMIT $3
"#, "#,
) )