You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-06 09:19:22 +02:00
Chore: Fixed sorting logic for search API
This commit is contained in:
@@ -37,8 +37,8 @@ export default async function(request: Request) {
|
||||
results = (await SearchEngineUtils.notesForQuery(query, false, options)).notes;
|
||||
}
|
||||
|
||||
// We do not sort the results because the search engine has already sorted them in order of
|
||||
// relevance.
|
||||
// We do not sort the results if the "order_by" query parameter is not specified, because the
|
||||
// search engine has already sorted them in order of relevance.
|
||||
// https://github.com/laurent22/joplin/issues/10088
|
||||
return collectionToPaginatedResults(modelType, results, request, { sort: false });
|
||||
return collectionToPaginatedResults(modelType, results, request, { sort: !!request.query.order_by });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user