diff --git a/server/src/handlers/meta.rs b/server/src/handlers/meta.rs index 19bd82b..eaf2be3 100644 --- a/server/src/handlers/meta.rs +++ b/server/src/handlers/meta.rs @@ -341,10 +341,14 @@ impl McpTool for OmniSearchHandler { let req: OmniSearchTool = serde_json::from_value(args).map_err(|e| e.to_string())?; let limit = req.limit.unwrap_or(5); let include_body = req.include_body.unwrap_or(false); - let matches = { - let idx = state.get_search_index(); - idx.search(&req.query, req.namespace.as_deref()) - .unwrap_or_default() + let matches = match state.get_search_index().search(&req.query, req.namespace.as_deref()) { + Ok(m) => m, + Err(e) => { + return Err(format!( + "Search query failed (possibly malformed Lucene syntax). Error: {}", + e + )); + } }; println!("OMNI SEARCH MATCHES: {:?}", matches);