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.

fix(search): skip entity types with ids_only and empty IDs in unified search (#2529)

gbirman1c72e4f62cc0
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 8556ed0160..473ec57eb4 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
@@ -275,16 +275,21 @@ pub(in crate::api::search) async fn perform_unified_search(
collapse,
search_indices: {
let mut indices = std::collections::HashSet::new();
- if should_include_documents {
+ if should_include_documents
+ && !(filter_document_response.ids_only
+ && filter_document_response.document_ids.is_empty())
+ {
indices.insert(models_opensearch::SearchEntityType::Documents);
}
- if should_include_chats {
+ if should_include_chats
+ && !(filter_chat_response.ids_only && filter_chat_response.chat_ids.is_empty())
+ {
indices.insert(models_opensearch::SearchEntityType::Chats);
}
if should_include_emails {
indices.insert(models_opensearch::SearchEntityType::Emails);
}
- if should_include_channels {
+ if should_include_channels && !filter_channel_response.channel_ids.is_empty() {
indices.insert(models_opensearch::SearchEntityType::Channels);
}
if should_include_projects {