diff options
author | Robin Appelman <robin@icewind.nl> | 2021-03-19 14:29:08 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-23 13:41:21 +0000 |
commit | 2c565d68bc3da3f6183e81c53398d40b3d990544 (patch) | |
tree | 403d0c01b43024902467df6fdf20f2182462c595 /apps/files/lib | |
parent | d4381c0eac568273367389985565a52c28e1dcfe (diff) | |
download | nextcloud-server-2c565d68bc3da3f6183e81c53398d40b3d990544.tar.gz nextcloud-server-2c565d68bc3da3f6183e81c53398d40b3d990544.zip |
pass order from unified search to file search
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Search/FilesSearchProvider.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php index 180ce45ce09..5571d41bda5 100644 --- a/apps/files/lib/Search/FilesSearchProvider.php +++ b/apps/files/lib/Search/FilesSearchProvider.php @@ -30,12 +30,14 @@ declare(strict_types=1); namespace OCA\Files\Search; use OC\Files\Search\SearchComparison; +use OC\Files\Search\SearchOrder; use OC\Files\Search\SearchQuery; use OCP\Files\FileInfo; use OCP\Files\IMimeTypeDetector; use OCP\Files\IRootFolder; use OCP\Files\Search\ISearchComparison; use OCP\Files\Node; +use OCP\Files\Search\ISearchOrder; use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUser; @@ -104,7 +106,9 @@ class FilesSearchProvider implements IProvider { new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%' . $query->getTerm() . '%'), $query->getLimit(), (int)$query->getCursor(), - [], + $query->getSortOrder() === ISearchQuery::SORT_DATE_DESC ? [ + new SearchOrder(ISearchOrder::DIRECTION_DESCENDING, 'mtime'), + ] : [], $user ); |