diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts index 6103b0e0f..ccdee87b1 100644 --- a/packages/backend/src/core/SearchService.ts +++ b/packages/backend/src/core/SearchService.ts @@ -183,7 +183,7 @@ export class SearchService { } } const res = await this.meilisearchNoteIndex!.search(q, { - sort: [`createdAt:${opts.order}`], + sort: [`createdAt:${opts.order ? opts.order : 'desc'}`], matchingStrategy: 'all', attributesToRetrieve: ['id', 'createdAt'], filter: compileQuery(filter),