Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore(search): exit early if all search indices are empty (#2233)

gbirmanbcb183993197
diff --git a/rust/cloud-storage/search_service/src/api/search/simple/simple_unified.rs b/rust/cloud-storage/search_service/src/api/search/simple/simple_unified.rs
index 6145490c24..8556ed0160 100644
--- a/rust/cloud-storage/search_service/src/api/search/simple/simple_unified.rs
+++ b/rust/cloud-storage/search_service/src/api/search/simple/simple_unified.rs
@@ -427,7 +427,9 @@ pub(in crate::api::search) async fn perform_unified_search(
// We only want to search over content if you are not searching name only
match search_on {
SearchOn::Content | SearchOn::NameContent => {
- if let SearchCursorOption::Done = unified_search_args.cursor {
+ if unified_search_args.search_indices.is_empty() {
+ Ok((vec![], SearchCursorOption::Done))
+ } else if let SearchCursorOption::Done = unified_search_args.cursor {
Ok((vec![], SearchCursorOption::Done))
} else {
ctx.opensearch_client