mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Chore: Fixed sorting logic for search API
This commit is contained in:
parent
5cdc1e93b3
commit
431ce430a0
@ -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 });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user