Fix semantic search: query chunks instead of empty parent_chunks table
This commit is contained in:
@@ -4622,13 +4622,13 @@ impl PostgresDb {
|
||||
let results = sqlx::query_as::<_, SemanticSearchResult>(
|
||||
r#"
|
||||
SELECT
|
||||
id, scene_order, start_time, end_time,
|
||||
summary_text as summary,
|
||||
id, chunk_index as scene_order, start_time, end_time,
|
||||
COALESCE(summary_text, text_content, '') as summary,
|
||||
metadata,
|
||||
(1 - (summary_vector <=> $1::vector)) as similarity
|
||||
FROM parent_chunks
|
||||
WHERE uuid = $2
|
||||
ORDER BY summary_vector <=> $1::vector
|
||||
(1 - (embedding <=> $1::vector)) as similarity
|
||||
FROM dev.chunks
|
||||
WHERE file_uuid = $2 AND chunk_type = 'cut' AND embedding IS NOT NULL
|
||||
ORDER BY embedding <=> $1::vector
|
||||
LIMIT $3
|
||||
"#,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user