diff --git a/server/models/helpers/SearchHelper.ts b/server/models/helpers/SearchHelper.ts index 277575b13..8d47d1581 100644 --- a/server/models/helpers/SearchHelper.ts +++ b/server/models/helpers/SearchHelper.ts @@ -72,7 +72,10 @@ export default class SearchHelper { offset = 0, } = options; - const where = await this.buildWhere(team, options); + const where = await this.buildWhere(team, { + ...options, + statusFilter: [...(options.statusFilter || []), StatusFilter.Published], + }); if (options.share?.includeChildDocuments) { const sharedDocument = await options.share.$get("document"); @@ -391,12 +394,6 @@ export default class SearchHelper { }, ], }); - } else { - statusQuery.push({ - publishedAt: { - [Op.ne]: null, - }, - }); } if (options.statusFilter?.includes(StatusFilter.Archived)) {