feat: trace_id i64→i32 fix, OCR search filter, Rule1 OCR trigger

- Fix trace_id SQL type mismatch: i64 → i32 in profile.rs structs and queries
- Add /ocr /asr /asrx search filter suffix to keyword/semantic/smart search
- Fix fetch_ocr_texts to handle both OCR data formats (string array + object array)
- Add has_ocr trigger for Rule1 chunk ingestion in job_worker.rs
- Add search_bm25 chunk_type filter parameter
- Fix single-frame video clip duration (0-frame → 1-frame minimum)
- Re-run Rule1 for 14 files with stuck OCR in pre_chunks
This commit is contained in:
Accusys
2026-07-30 19:34:35 +08:00
parent 5d0c771a2b
commit 85d5e1fe51
20 changed files with 1783 additions and 412 deletions
+12 -9
View File
@@ -242,16 +242,19 @@ async fn fetch_ocr_texts(
.map(|arr| {
arr.iter()
.filter_map(|item| {
let text = item.get("text").and_then(|t| t.as_str())?;
let confidence = item
.get("confidence")
.and_then(|c| c.as_f64())
.unwrap_or(0.0);
if confidence > OCR_CONFIDENCE_THRESHOLD {
Some(text.to_string())
} else {
None
// Format A: array of objects with text/confidence fields
if let Some(obj_text) = item.get("text").and_then(|t| t.as_str()) {
let confidence = item
.get("confidence")
.and_then(|c| c.as_f64())
.unwrap_or(0.0);
if confidence > OCR_CONFIDENCE_THRESHOLD {
return Some(obj_text.to_string());
}
return None;
}
// Format B: array of plain strings
item.as_str().map(|s| s.to_string())
})
.collect()
})