Array of account/provider pairs to search
Search query string
Search configuration including context user for credentials
A promise that resolves to aggregated results grouped by account
const accounts = [
{ accountEntity: researchDropbox, providerEntity: dropboxProvider },
{ accountEntity: marketingDropbox, providerEntity: dropboxProvider },
{ accountEntity: engineeringGDrive, providerEntity: gdriveProvider }
];
const result = await searchAcrossAccounts(accounts, 'quarterly report', {
maxResultsPerAccount: 25,
fileTypes: ['pdf', 'docx'],
contextUser: currentUser
});
for (const accountResult of result.accountResults) {
if (accountResult.success) {
console.log(`${accountResult.accountName}: ${accountResult.results.length} results`);
}
}
Searches for files across multiple storage accounts in parallel.
This is the enterprise version of search that uses the account-based credential model. Each account is searched independently, allowing multiple accounts from the same provider type to be searched (e.g., two different Dropbox accounts).