Improve LightRAG knowledge search locator alignment

This commit is contained in:
lix-2026
2026-06-08 20:35:49 +08:00
parent 9551d4c1dc
commit 0e8b03daf8
28 changed files with 5769 additions and 140 deletions
+19 -4
View File
@@ -207,7 +207,9 @@ pub async fn documents(
&effective_workspace_id,
&root_path,
)?;
local_search_index::query_local_search_index_with_settings(
let include_ocr = filters.include_ocr.unwrap_or(false);
let limit = body.limit.unwrap_or(30);
let local_result = local_search_index::query_local_search_index_with_settings(
&root_path,
root_uri,
&effective_workspace_id,
@@ -215,11 +217,12 @@ pub async fn documents(
&user_settings,
&normalized_query,
page_id.as_deref(),
body.limit.unwrap_or(30),
limit,
filters.title_only.unwrap_or(false),
filters.exact.unwrap_or(false),
filters.include_ocr.unwrap_or(false),
)?
include_ocr,
)?;
local_result
} else {
load_search_results_with_filters(
state.config(),
@@ -1019,6 +1022,18 @@ mod tests {
payload["meta"]["boundary"]["evidenceSqliteFallback"].as_bool(),
Some(false)
);
assert_eq!(
payload["meta"]["boundary"]["kind"].as_str(),
Some("ordinary_local_search")
);
assert_eq!(
payload["meta"]["boundary"]["ocrSidecarFallback"].as_bool(),
Some(false)
);
assert_eq!(
payload["meta"]["boundary"]["knowledgeRag"].as_bool(),
Some(false)
);
assert!(payload["evidence"].as_array().expect("evidence").is_empty());
assert!(home["tags"]
.as_array()