feat: face fix deployment + trace_* regeneration + executor stderr filter fix
- swift_face.swift: frame rounding (.rounded()), conf 0.75, min_size 64 - trace_* directories regenerated for KOBA (37 traces, start_frame 5307) - executor.rs: stderr filter now logs all non-empty stderr (was discarding) - VAD not skippable in ASRX (main_fixed.py Step 2 always runs) - Step 2.5 sentence boundary refinement added - Cluster agent async endpoints + similarity transparency - Keyword search: relationship text extraction, priority ordering - Face fix handoff doc for Studio team
This commit is contained in:
+24
-11
@@ -183,9 +183,7 @@ pub async fn smart_search(
|
||||
let limit = hard_limit.min(page_size);
|
||||
|
||||
let (clean_query, source_filter) = parse_source_filter(&req.query);
|
||||
let chunk_type_filter = source_filter
|
||||
.as_deref()
|
||||
.map(source_filter_to_chunk_type);
|
||||
let chunk_type_filter = source_filter.as_deref().map(source_filter_to_chunk_type);
|
||||
|
||||
// 1. Generate embedding from clean query
|
||||
let embedder = Embedder::new("embeddinggemma-300m".to_string());
|
||||
@@ -235,7 +233,12 @@ pub async fn smart_search(
|
||||
|
||||
// 3. Keyword search via PG ILIKE
|
||||
let keyword_results: Vec<(String, String, f64)> = match db
|
||||
.search_bm25(&clean_query, req.file_uuid.as_deref(), chunk_type_filter, fetch_limit as i64)
|
||||
.search_bm25(
|
||||
&clean_query,
|
||||
req.file_uuid.as_deref(),
|
||||
chunk_type_filter,
|
||||
fetch_limit as i64,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(rows) => {
|
||||
@@ -624,16 +627,19 @@ pub async fn keyword_search(
|
||||
) -> Result<Json<SmartSearchResponse>, (StatusCode, Json<serde_json::Value>)> {
|
||||
let db = &state.db;
|
||||
let page = req.page.unwrap_or(1).max(1);
|
||||
let limit = req.limit.unwrap_or(req.page_size.unwrap_or(5)).max(1);
|
||||
let limit = req.limit.unwrap_or(req.page_size.unwrap_or(50)).max(1);
|
||||
|
||||
let (clean_query, source_filter) = parse_source_filter(&req.query);
|
||||
let chunk_type_filter = source_filter
|
||||
.as_deref()
|
||||
.map(source_filter_to_chunk_type);
|
||||
let chunk_type_filter = source_filter.as_deref().map(source_filter_to_chunk_type);
|
||||
|
||||
// Keyword search via PG BM25
|
||||
let keyword_results = db
|
||||
.search_bm25(&clean_query, req.file_uuid.as_deref(), chunk_type_filter, limit as i64)
|
||||
.search_bm25(
|
||||
&clean_query,
|
||||
req.file_uuid.as_deref(),
|
||||
chunk_type_filter,
|
||||
limit as i64,
|
||||
)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tracing::error!("Keyword search failed: {}", e);
|
||||
@@ -655,6 +661,13 @@ pub async fn keyword_search(
|
||||
.get_chunk_by_id_no_embedding(&row.file_uuid, &row.chunk_id)
|
||||
.await
|
||||
{
|
||||
// Use extracted text from BM25 result for relationships, otherwise use chunk's text_content
|
||||
let text = if p.chunk_type == "relationship" {
|
||||
row.text.clone().or_else(|| p.text_content.clone())
|
||||
} else {
|
||||
p.text_content.clone()
|
||||
};
|
||||
|
||||
results.push(SearchResult {
|
||||
id: 0,
|
||||
file_uuid: p.file_uuid.clone(),
|
||||
@@ -666,8 +679,8 @@ pub async fn keyword_search(
|
||||
start_time: p.start_time,
|
||||
end_time: p.end_time,
|
||||
raw_text: None,
|
||||
summary: Some(p.summary.clone()),
|
||||
text_content: p.text_content.clone(),
|
||||
summary: text.clone(),
|
||||
text_content: text,
|
||||
metadata: p.metadata.clone(),
|
||||
similarity: Some(row.bm25_score as f64),
|
||||
file_name: None,
|
||||
|
||||
Reference in New Issue
Block a user